路由缓存问题、初次登录、系统内密码修改

This commit is contained in:
zhaoxiao
2021-10-11 12:00:31 +08:00
parent 34be7fae21
commit a5fb8026bf
8 changed files with 191 additions and 132 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ export default {
canEdit: true
}, {
title: '性别',
fieldName: 'gender',
fieldName: 'gender_dictText',
canEdit: true
}
], [
+4 -2
View File
@@ -150,10 +150,11 @@ import { mapActions } from 'vuex'
import { timeFix } from '@/utils/util'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { postAction, getAction } from '@/api/manage'
import { getAction } from '@/api/manage'
import { getRSAPublicKey } from '@/api/login.js'
import { JSEncrypt } from 'jsencrypt'
import { phoneReg } from '@/utils/validate'
import { phoneLogin } from '@/api/login.js'
export default {
components: {},
@@ -253,7 +254,7 @@ export default {
httpFunction = that.Login
}
httpFunction(loginParams).then((response) => {
if (response.message.indexOf('updatePassword') > -1) {
if (response.message === 'updatePassword') {
this.$notification['error']({
message: '设置密码',
description: '初次登录需要设置密码',
@@ -263,6 +264,7 @@ export default {
path: '/user/alteration',
query: {
isFirstLogin: 'true',
userInfo: JSON.stringify(response)
}
})
} else {
+16 -6
View File
@@ -36,6 +36,7 @@
<a-input
v-decorator="['captcha', { rules: validatorRules.captcha.rules}]"
type="text"
autocomplete="off"
placeholder="验证码">
</a-input>
<a-button
@@ -100,6 +101,8 @@ import { getAction, postAction } from '@/api/manage'
import { getRSAPublicKey } from '@api/login'
import { JSEncrypt } from 'jsencrypt'
import { timeFix } from '@/utils/util'
import { mapActions } from 'vuex'
export default {
name: 'Alteration',
@@ -144,6 +147,7 @@ export default {
}
},
methods: {
...mapActions(['FirstPhoneLogin']),
submit() {
let that = this
that.loading = true
@@ -162,12 +166,18 @@ export default {
if (res.success) {
that.loading = false
if (this.$route.query.isFirstLogin === 'true') {
// 进入首页
this.$router.push({ path: '/' }).catch(() => {
})
this.$notification.success({
message: '欢迎',
description: `${ timeFix() },欢迎回来`
let loginResponse = JSON.parse(that.$route.query.userInfo)
that.FirstPhoneLogin(loginResponse).then(res => {
if (res.code === 200) {
that.FirstPhoneLogin(loginResponse)
// 进入首页
this.$router.push({ path: '/' }).catch(() => {
})
this.$notification.success({
message: '欢迎',
description: `${ timeFix() },欢迎回来`
})
}
})
} else {
that.$router.go(-1)