Commit 72528d8d authored by 张伯涛's avatar 张伯涛

涉及到密码修改的地方多调用一个接口

parent f2b71fe3
......@@ -128,7 +128,13 @@ export function resetUserPwd(businessId, password) {
params: data
})
}
export function updatePassword(query) {
return request({
url: '/pc/sysuser/updatePassword',
method: 'get',
params: query
})
}
// 11.用户状态修改
export function changeUserStatus(businessId, flag) {
const data = {
......
......@@ -4,6 +4,7 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
loginId: state => state.user.loginId,
specialTag: state => state.user.specialTag,
roles: state => state.user.roles,
introduction: state => state.user.introduction,
......
......@@ -7,6 +7,7 @@ const user = {
state: {
token: getToken(),
name: '',
loginId: '',
avatar: '',
roles: [],
permissions: [],
......@@ -24,6 +25,9 @@ const user = {
SET_NAME: (state, name) => {
state.name = name
},
SET_LOGINID: (state, loginId) => {
state.loginId = loginId
},
SET_SPECIALTAG: (state, specialTag) => {
state.specialTag = specialTag
},
......@@ -71,6 +75,7 @@ const user = {
}
commit('SET_PERMISSIONS', res.data.permissions)
commit('SET_NAME', user.username)
commit('SET_LOGINID', user.businessId)
const type = '1' // 1是开启,2是关闭
commit('SET_TYPE', type)
commit('SET_SPECIALTAG', user.specialTag)
......
<template>
<section class="forget-pwd-content">
<!-- <page-divider />-->
<!-- <page-divider />-->
<div class="title">修改密码</div>
<el-form
ref="pwdForm"
......@@ -45,7 +45,7 @@
</section>
</template>
<script>
import { updateUserPwd } from '@/api/system/user.js'
import { updatePassword, updateUserPwd } from '@/api/system/user.js'
import { encryptTwo } from '@/utils/jsencrypt'
export default {
name: 'ReSetPsw',
......@@ -110,10 +110,19 @@ export default {
newPassword: encryptTwo(this.pwdList.pass)
}
updateUserPwd(params).then(res => {
this.$message.success('密码修改成功!')
this.$store.dispatch('FedLogOut').then(() => {
location.reload()
})
if (res.code === 200) {
const params = {
businessId: this.$store.getters.loginId
}
console.log('11111111', this.$store.getters.loginId)
updatePassword(params).then(res => {
})
this.$message.success('密码修改成功!')
// this.$store.dispatch('FedLogOut').then(() => {
// location.reload()
// })
}
})
} else {
return false
......
......@@ -407,7 +407,7 @@ import {
changeUserStatus,
importExcel,
uploadFalseFile,
importTemplate
importTemplate, updatePassword
} from '@/api/system/user'
import { getToken } from '@/utils/auth'
import { treeSelect } from '@/api/system/dept'
......@@ -856,6 +856,12 @@ export default {
type: 'success'
})
this.resetPwdDiaLog = false
const params = {
businessId: this.ruleForm.row
}
updatePassword(params).then(res => {
})
}
this.userRestLoading = false
}).catch(e => { this.userRestLoading = false })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment