refactor(登录页面): ♻️ 登录优化

This commit is contained in:
猿小天
2023-04-09 23:08:30 +08:00
committed by H0nGzA1
parent d2d6ba3460
commit 15c4808bbb
5 changed files with 17 additions and 9 deletions

View File

@@ -9,8 +9,8 @@ export default {
two4: 'Links', two4: 'Links',
}, },
account: { account: {
accountPlaceholder1: 'The user name admin or not is common', accountPlaceholder1: 'Please enter your login account',
accountPlaceholder2: 'Password: 123456', accountPlaceholder2: 'Please enter your login password',
accountPlaceholder3: 'Please enter the verification code', accountPlaceholder3: 'Please enter the verification code',
accountBtnText: 'Sign in', accountBtnText: 'Sign in',
}, },

View File

@@ -9,8 +9,8 @@ export default {
two4: '友情链接', two4: '友情链接',
}, },
account: { account: {
accountPlaceholder1: '用户名 admin 或不输均为 common', accountPlaceholder1: '请输入登录账号',
accountPlaceholder2: '密码123456', accountPlaceholder2: '请输入登录密码',
accountPlaceholder3: '请输入验证码', accountPlaceholder3: '请输入验证码',
accountBtnText: '登 录', accountBtnText: '登 录',
}, },

View File

@@ -9,8 +9,8 @@ export default {
two4: '友情連結', two4: '友情連結',
}, },
account: { account: {
accountPlaceholder1: '用戶名admin或不輸均為common', accountPlaceholder1: '請輸入登入賬號',
accountPlaceholder2: '密碼123456', accountPlaceholder2: '請輸入登入密碼',
accountPlaceholder3: '請輸入驗證碼', accountPlaceholder3: '請輸入驗證碼',
accountBtnText: '登入', accountBtnText: '登入',
}, },

View File

@@ -70,7 +70,7 @@ function createService() {
case 401: case 401:
Local.clear(); Local.clear();
Session.clear(); Session.clear();
dataAxios.msg = '登录授权过期,请重新登录'; dataAxios.msg = '登录认证失败,请重新登录';
ElMessageBox.alert(dataAxios.msg, '提示', { ElMessageBox.alert(dataAxios.msg, '提示', {
confirmButtonText: 'OK', confirmButtonText: 'OK',
callback: (action: Action) => { callback: (action: Action) => {
@@ -100,7 +100,15 @@ function createService() {
error.message = '请求错误'; error.message = '请求错误';
break; break;
case 401: case 401:
error.message = '未授权,请登录'; Local.clear();
Session.clear();
error.message = '登录授权过期,请重新登录';
ElMessageBox.alert(error.message, '提示', {
confirmButtonText: 'OK',
callback: (action: Action) => {
window.location.reload();
},
})
break; break;
case 403: case 403:
error.message = '拒绝访问'; error.message = '拒绝访问';

View File

@@ -30,7 +30,7 @@ const websocket: socket = {
} }
const token = Session.get('token') const token = Session.get('token')
if(!token){ if(!token){
message.warning('websocket认证失败') // message.warning('websocket认证失败')
return null return null
} }
const wsUrl = `${getWsBaseURL()}ws/${token}/` const wsUrl = `${getWsBaseURL()}ws/${token}/`