Browse Source

fix:[登录模块] [锁屏] 双语修改

luojie
memorylkf 3 weeks ago
parent
commit
9d488bce5b
7 changed files with 26 additions and 16 deletions
  1. +2
    -1
      src/App.vue
  2. +6
    -1
      src/lang/en.js
  3. +2
    -2
      src/lang/en/system/user.js
  4. +4
    -1
      src/lang/zh.js
  5. +2
    -2
      src/lang/zh/system/user.js
  6. +8
    -7
      src/utils/request.js
  7. +2
    -2
      src/views/system/user/index.vue

+ 2
- 1
src/App.vue View File

@ -107,7 +107,8 @@ export default {
console.log(JSON.stringify(response))
}).catch(err => {
console.log(JSON.stringify(err))
if (err === '无效的会话,或者会话已过期,请重新登录。') {
// if (err === '') {
if (err === this.$t('system.timeOutTip')) {
this.stopStatusCheck()
}
})

+ 6
- 1
src/lang/en.js View File

@ -22,7 +22,12 @@ export default {
tip: 'Prompt',
logOut: 'Are You Sure To Log Out And Exit The System?',
crowdOut:
'This Account Has Already Been Logged In From Another Location. Do You Want To Continue Logging In And Replace The Original Login Account'
'This Account Has Already Been Logged In From Another Location. Do You Want To Continue Logging In And Replace The Original Login Account',
timeOutContent:
'The login status has expired. You can enter your password to access the page, or cancel',
timeOutEnter: 'Enter',
timeOutTip: 'Invalid Session, Or Session Has Expired. Please Log In Again.'
},
form: {
search: 'Search',

+ 2
- 2
src/lang/en/system/user.js View File

@ -15,8 +15,8 @@ export default {
edit: 'Edit',
history: 'Role History',
addRole: 'Create',
modifyRole: 'Edit',
addUser: 'Create',
modifyUser: 'Edit',
notEmpty: ' Can Not Be Empty',
phoneError: 'Please Enter A Correct Phone Number'
}

+ 4
- 1
src/lang/zh.js View File

@ -21,7 +21,10 @@ export default {
title: '华西海圻管理系统',
tip: '提示',
logOut: '确认注销并退出系统吗?',
crowdOut: '该账户已在其他地方登录,是否继续登录,继续登录挤掉原登录账号'
crowdOut: '该账户已在其他地方登录,是否继续登录,继续登录挤掉原登录账号',
timeOutContent: '登录状态已过期,您可以输入密码进入页面,或者取消',
timeOutEnter: '进入页面',
timeOutTip: '无效的会话,或者会话已过期,请重新登录。'
},
form: {
search: '查询',

+ 2
- 2
src/lang/zh/system/user.js View File

@ -15,8 +15,8 @@ export default {
edit: '编辑',
history: '角色变更历史',
addRole: '新增角色',
modifyRole: '编辑角色',
addUser: '新增角色',
modifyUser: '编辑角色',
notEmpty: '不能为空',
phoneError: '请输入正确的手机号码'
}

+ 8
- 7
src/utils/request.js View File

@ -1,5 +1,5 @@
import axios from 'axios'
import { Notification, MessageBox, Message, Loading, Dialog } from 'element-ui'
import { Notification, MessageBox, Message, Loading } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
@ -133,13 +133,14 @@ service.interceptors.response.use(
// })
MessageBox.prompt(
'登录状态已过期,您可以输入密码进入页面,或者取消',
'提示',
i18n.t('system.timeOutContent'),
i18n.t('system.tip'),
{
confirmButtonText: '进入页面',
cancelButtonText: '取消',
confirmButtonText: i18n.t('system.timeOutEnter'),
cancelButtonText: i18n.t('form.cancel'),
inputPattern: /^\S+$/,
inputErrorMessage: '请输入密码',
inputPlaceholder: i18n.t('login.password'),
inputErrorMessage: i18n.t('login.password'),
showClose: false,
closeOnPressEscape: false,
closeOnClickModal: false,
@ -221,7 +222,7 @@ service.interceptors.response.use(
location.href = '/user/work'
})
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
return Promise.reject(i18n.t('system.timeOutTip'))
} else if (code === 500) {
if (msg !== 'exists') {
Message({ message: msg, type: 'error' })

+ 2
- 2
src/views/system/user/index.vue View File

@ -516,7 +516,7 @@ export default {
this.postOptions = response.posts
this.roleOptions = response.roles
this.open = true
this.title = "添加用户"
this.title = this.$t('page.system.user.addUser')
this.form.password = this.initPassword
})
},
@ -531,7 +531,7 @@ export default {
this.$set(this.form, "postIds", response.postIds)
this.$set(this.form, "roleIds", response.roleIds)
this.open = true
this.title = "修改用户"
this.title = this.$t('page.system.user.modifyUser')
this.form.password = ""
})
},

Loading…
Cancel
Save