feat: 默认密码提示改密并同步latest包,升至1.1.17
This commit is contained in:
@@ -304,6 +304,16 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
isDefaultPassword(loginData) {
|
||||
const value = loginData && loginData.is_default_password;
|
||||
return value === true || value === 1 || value === '1' || value === 'true';
|
||||
},
|
||||
enterWorkbench(openPasswordPage) {
|
||||
const url = openPasswordPage
|
||||
? '/pages/sys/workbench/index?changePassword=1'
|
||||
: '/pages/sys/workbench/index';
|
||||
uni.reLaunch({ url });
|
||||
},
|
||||
submit(loginType = '1') {
|
||||
uni.showLoading({
|
||||
title: '登录中...'
|
||||
@@ -363,31 +373,41 @@ export default {
|
||||
console.log('自动匹配扫码设置失败', scanError);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/sys/workbench/index'
|
||||
});
|
||||
}, 500);
|
||||
|
||||
var that = this
|
||||
if (that.remember == true) {
|
||||
if (this.remember == true) {
|
||||
if ((this.login.username.length > 0) && (this.login.password.length > 0)) {
|
||||
uni.setStorage({
|
||||
key: 'UserInfo',
|
||||
data: that.login
|
||||
data: this.login
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.$store.dispatch('initNotification');
|
||||
uni.hideLoading();
|
||||
|
||||
if (this.isDefaultPassword(aLoginUserData)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前使用的是默认密码,请及时修改密码',
|
||||
confirmText: '去修改',
|
||||
cancelText: '稍后',
|
||||
success: (modalRes) => {
|
||||
this.enterWorkbench(!!(modalRes && modalRes.confirm));
|
||||
},
|
||||
fail: () => {
|
||||
this.enterWorkbench(false);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '登录成功!'
|
||||
});
|
||||
this.$store.dispatch('initNotification');
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 1000);
|
||||
setTimeout(() => {
|
||||
this.enterWorkbench(false);
|
||||
}, 500);
|
||||
}).catch((error) => {
|
||||
console.log('login error', error)
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user