Browse Source

1. 密码策略需求变更,HL-6189

hella_online_20241011
bjang03 2 months ago
parent
commit
2c9d62dcca
  1. 2
      src/config/axios/service.ts
  2. 26
      src/views/login/components/LoginForm.vue
  3. 3
      src/views/system/user/index.vue

2
src/config/axios/service.ts

@ -182,7 +182,7 @@ service.interceptors.response.use(
'<div>5 分钟搭建本地环境</div>'
})
return Promise.reject(new Error(msg))
} else if (code === 1002000010) {
} else if (code === 1002000008) {
if (msg === '无效的刷新令牌') {
// hard coding:忽略这个提示,直接登出
console.log(msg)

26
src/views/login/components/LoginForm.vue

@ -262,7 +262,7 @@
switch (differenceDays){
case null:
break
case 0:
case 0 || 1:
await ElMessageBox.alert(
'<strong>密码到期,请立即修改</strong>',
'重要提示',
@ -272,15 +272,15 @@
)
router.push({path:"/updatePasswordNewTips",query:{username:loginData.loginForm.username}})
return
case 1:
await ElMessageBox.alert(
'<strong>密码过期,请联系管理员修改</strong>',
'重要提示',
{
dangerouslyUseHTMLString: true,
}
)
return
// case 1:
// await ElMessageBox.alert(
// '<strong></strong>',
// '',
// {
// dangerouslyUseHTMLString: true,
// }
// )
// return
default:
await ElMessageBox.alert(
'密码'+differenceDays+'到期,请尽快修改。',
@ -330,6 +330,12 @@
//
const { wsCache } = useCache()
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
}catch (e){
if(e.code === 1002000008){
setTimeout(function (){
router.push({path:"/updatePasswordNewTips",query:{username:loginData.loginForm.username}})
},1500)
}
}finally {
console.log('登录-224')
loginLoading.value = false

3
src/views/system/user/index.vue

@ -59,6 +59,8 @@
<el-table-column label="部门" align="center" key="deptName" prop="dept.name" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" prop="mobile" width="120" />
<el-table-column label="是否冻结" align="center" prop="frozenStatus" width="80" />
<el-table-column label="上次密码修改时间" align="center" prop="passwordUpdateTime" width="180" :formatter="dateFormatter"/>
<el-table-column label="冻结到期时间" align="center" prop="frozenEndTime" width="180" :formatter="dateFormatter"/>
<el-table-column label="状态" align="center" key="status">
<template #default="scope">
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1"
@ -262,7 +264,6 @@ const handleDelete = async (id: number) => {
/** 解冻按钮操作 */
const handleFree = async (row: any) => {
try {
debugger
//
if(row.frozenStatus=="是"){
await UserApi.unLockUser(row.id)

Loading…
Cancel
Save