From d6bfd2d262ce075fd20d8b407dab41780d6320ae Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Mon, 16 Jun 2025 23:21:21 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app.js b/app.js index 1c78299..83c6952 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,5 @@ const { checkLogin } = require('./utils/logcheck'); App({ - onLaunch() { - // checkLogin(); - }, + }); From 949d39b1b99a9563bec0eac420b5f65feefd5f71 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Mon, 16 Jun 2025 23:30:02 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 83c6952..55b54d0 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,7 @@ const { checkLogin } = require('./utils/logcheck'); App({ - + onLaunch: function () { + checkLogin(); + } }); From c93b47162574b2d6e3d9c2b022ccfd72adc37b4a Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 08:26:41 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app.js b/app.js index 55b54d0..0047efc 100644 --- a/app.js +++ b/app.js @@ -3,5 +3,7 @@ App({ onLaunch: function () { checkLogin(); + checkLogin(); + checkLogin(); } }); From 3d1e60edc5df7df3787c87d8c38a5d73a5acce06 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 08:38:14 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app.js b/app.js index 0047efc..55b54d0 100644 --- a/app.js +++ b/app.js @@ -3,7 +3,5 @@ App({ onLaunch: function () { checkLogin(); - checkLogin(); - checkLogin(); } }); From a797150e3e109f06fb74009bdd0a6dab33d0d51a Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 08:39:16 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app.js b/app.js index 55b54d0..6e5db1c 100644 --- a/app.js +++ b/app.js @@ -3,5 +3,6 @@ App({ onLaunch: function () { checkLogin(); + checkLogin(); } }); From 0de7e859c29e7c0516c8716c73ac7cb960ee7501 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 09:04:01 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.js b/app.js index 6e5db1c..b8db679 100644 --- a/app.js +++ b/app.js @@ -4,5 +4,9 @@ App({ onLaunch: function () { checkLogin(); checkLogin(); + checkLogin(); + checkLogin(); + checkLogin(); + checkLogin(); } }); From 1e2593fd3be8eaee91c64c2756fd4d34014f4dac Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 18:17:05 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/loginModule/register/register.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pages/loginModule/register/register.js b/pages/loginModule/register/register.js index 2aa6998..0f26104 100644 --- a/pages/loginModule/register/register.js +++ b/pages/loginModule/register/register.js @@ -89,6 +89,29 @@ Page({ agree: e.detail.value.length > 0 }); }, + validatePassword(password) { + // 校验密码长度 + if (password.length < 6 || password.length > 10) { + wx.showToast({ + title: '密码长度应在6到10个字符之间', + icon: 'none', + duration: 1000 + }); + return false; + } + + // 校验是否包含字母、数字和下划线 + const regex = /^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z0-9]+$/; + if (!regex.test(password)) { + wx.showToast({ + title: '密码必须包含字母和数字,且不包含特殊字符', + icon: 'none', + duration: 1000 + }); + return false; + } + return true; + }, // 注册按钮点击 async onRegister() { @@ -102,12 +125,13 @@ Page({ })) { return; } + const { nickname, phone, captcha, inviteCode, password } = this.data; + if (!this.validatePassword(password)) return ; // 2. 再单独校验协议勾选 if (!this.data.agree) { wx.showToast({ title: '请先同意用户协议', icon: 'none' }); return; } - const { nickname, phone, captcha, inviteCode, password } = this.data; wx.showLoading({ title: '加载中', mask: true From 3ce43e880db58bf11a058f259201d166430c4717 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 18:43:08 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=822222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 9 ++++++--- utils/logcheck.js | 27 ++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 6e5db1c..c3a6696 100644 --- a/app.js +++ b/app.js @@ -1,8 +1,11 @@ -const { checkLogin } = require('./utils/logcheck'); +const { checkLogin, checkLogin2 } = require('./utils/logcheck'); App({ onLaunch: function () { - checkLogin(); - checkLogin(); + checkLogin2() + checkLogin2() + checkLogin2() + checkLogin2() + checkLogin2() } }); diff --git a/utils/logcheck.js b/utils/logcheck.js index cdde082..75d25e3 100644 --- a/utils/logcheck.js +++ b/utils/logcheck.js @@ -20,6 +20,31 @@ function checkLogin() { } } + +function checkLogin2() { + try { + const user = wx.getStorageSync('usermessage'); + if (!user || (typeof user === 'object' && Object.keys(user).length === 0)) { + wx.showToast({ + title: '您未登录请先登录', + icon:'error', + duration:2000 + }) + setTimeout(() => { + wx.navigateTo({ + url: '/pages/logain/logain', + }); + }, 2000); + } + } catch (e) { + wx.navigateTo({ + url: '/pages/logain/logain', + }); + } +} + + + module.exports = { - checkLogin + checkLogin, checkLogin2 }; From 9b8b40d2ed644fa94c7785bf2e30208dd9fb72fb Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 17 Jun 2025 19:10:59 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82333?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app.js b/app.js index b8db679..89cc79e 100644 --- a/app.js +++ b/app.js @@ -2,11 +2,5 @@ const { checkLogin } = require('./utils/logcheck'); App({ onLaunch: function () { - checkLogin(); - checkLogin(); - checkLogin(); - checkLogin(); - checkLogin(); - checkLogin(); } });