From 59e699b4f6ba9ed9141d255e5cbafc23f7f596e1 Mon Sep 17 00:00:00 2001 From: HongxuanG <1359774872@qq.com> Date: Tue, 3 Nov 2026 16:01:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=99=BB=E5=BD=95=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=8F=90=E7=A4=BA=E6=94=B9=E5=AF=86=E5=B9=B6?= =?UTF-8?q?=E5=8F=AF=E5=8F=96=E6=B6=88=EF=BC=8C=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E8=87=B31.1.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/manifest.json | 4 ++-- src/pages/sys/login/index.vue | 40 ++++++++++++++++++++++++++--------- src/pages/sys/user/pwd.vue | 37 ++++++++++++++++++++++++++++---- 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index db0eab7..1d4b848 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "浩拓织厂", "appid" : "__UNI__F79F300", "description" : "周尚-浩拓织厂", - "versionName" : "1.1.18", - "versionCode" : 118, + "versionName" : "1.1.19", + "versionCode" : 119, "transformPx" : false, "app-plus" : { "optimization" : { diff --git a/src/pages/sys/login/index.vue b/src/pages/sys/login/index.vue index c5c63b9..f50bd4a 100644 --- a/src/pages/sys/login/index.vue +++ b/src/pages/sys/login/index.vue @@ -364,12 +364,6 @@ export default { console.log('自动匹配扫码设置失败', scanError); } - setTimeout(() => { - uni.reLaunch({ - url: '/pages/sys/workbench/index' - }); - }, 500); - var that = this if (that.remember == true) { if ((this.login.username.length > 0) && (this.login.password.length > 0)) { @@ -381,14 +375,40 @@ export default { } - uni.showToast({ - icon: 'none', - title: '登录成功!' - }); this.$store.dispatch('initNotification'); setTimeout(function () { uni.hideLoading(); }, 1000); + + const goWorkbench = () => { + uni.reLaunch({ + url: '/pages/sys/workbench/index' + }); + }; + + if (aLoginUserData.is_default_password) { + uni.showModal({ + title: '提示', + content: '检测到当前为默认密码,建议修改后再使用', + confirmText: '去修改', + cancelText: '取消', + success: (modalRes) => { + if (modalRes.confirm) { + uni.reLaunch({ + url: '/pages/sys/user/pwd?from=login' + }); + } else { + goWorkbench(); + } + } + }); + } else { + uni.showToast({ + icon: 'none', + title: '登录成功!' + }); + setTimeout(goWorkbench, 500); + } }).catch((error) => { console.log('login error', error) uni.showToast({ diff --git a/src/pages/sys/user/pwd.vue b/src/pages/sys/user/pwd.vue index 732d9c1..f5bb1e7 100644 --- a/src/pages/sys/user/pwd.vue +++ b/src/pages/sys/user/pwd.vue @@ -30,10 +30,11 @@ import base64 from '@/common/base64.js'; export default { data() { return { + fromLogin: false, model: { oldPassword: '', newPassword: '', - confirmNewPassword: '' + confirmPassword: '' }, rules: { oldPassword: [ @@ -72,10 +73,31 @@ export default { } }; }, + onLoad(options) { + this.fromLogin = options && options.from === 'login'; + }, onReady() { this.$refs.uForm.setRules(this.rules); }, + onBackPress() { + if (this.fromLogin) { + uni.reLaunch({ + url: '/pages/sys/workbench/index' + }); + return true; + } + return false; + }, methods: { + goAfterSuccess() { + if (this.fromLogin) { + uni.reLaunch({ + url: '/pages/sys/workbench/index' + }); + return; + } + uni.navigateBack(); + }, submit() { this.$refs.uForm.validate(valid => { if (valid) { @@ -84,12 +106,19 @@ export default { newPassword: this.model.newPassword }).then(res => { if(res.code == '200'){ + const userInfo = uni.getStorageSync('UserInfo'); + if (userInfo && typeof userInfo === 'object') { + uni.setStorageSync('UserInfo', { + ...userInfo, + password: this.model.newPassword + }); + } uni.showModal({ title: '提示', content: res.msg, showCancel: false, - success: function () { - uni.navigateBack(); + success: () => { + this.goAfterSuccess(); } }); }else{ @@ -106,7 +135,7 @@ export default { }); }, cancel() { - uni.navigateBack(); + this.goAfterSuccess(); } } };