Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20241011
zhaoxuebing 2 months ago
parent
commit
f2e1c447d9
  1. 4
      src/api/system/user/index.ts
  2. 2
      src/config/axios/service.ts
  3. 26
      src/views/login/components/LoginForm.vue
  4. 3
      src/views/login/updatePassword.vue
  5. 3
      src/views/system/user/index.vue

4
src/api/system/user/index.ts

@ -100,6 +100,10 @@ export const forgetPassword = (data : UserVO) => {
export const updatePassword = (data : UserVO) => {
return request.put({ url: '/system/user/updatePassword', data })
}
// 重置密码
export const updateUserPassword = (data : UserVO) => {
return request.put({ url: '/system/user/update-password', data })
}
export const getPassWordConfig = () => {
return request.get({ url: '/system/password/getConfig' })

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/login/updatePassword.vue

@ -36,6 +36,7 @@
import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login'
import * as UserApi from '@/api/system/user'
import { View,Hide } from '@element-plus/icons-vue'
import {updateUserPassword} from "@/api/system/user";
const { t } = useI18n()
const message = useMessage()
const permissionStore = usePermissionStore()
@ -65,7 +66,7 @@
message.error('两次输入的密码不一致,请重新输入!')
} else {
const data = loginData as unknown as UserApi.UserVO
await UserApi.updatePassword(data)
await UserApi.updateUserPassword(data)
//
message.success(t('common.updateSuccess'))
 router.go(-1)

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