From 0f02ececde81d3ce9c5c1717b8f2219aba149b70 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Sun, 18 May 2025 17:09:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(student):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AB=AF=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 清空默认用户名和密码 - 添加登录表单验证 - 增加登录类型选择提示 - 上线前保留测试账号密码(需删除) --- pages/student/login/login.vue | 44 +++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/pages/student/login/login.vue b/pages/student/login/login.vue index 1264ce1..1fe6d25 100644 --- a/pages/student/login/login.vue +++ b/pages/student/login/login.vue @@ -65,8 +65,8 @@ export default { data() { return { password: true, - user: '15374889135', //账户 - password1: '15374889135', //密码 + user: '', //账户 + password1: '', //密码 loginType:'',//登陆类型|1=教练,2=销售,3=学员 loginType_str:'',//登陆类型中文名字 @@ -108,6 +108,30 @@ export default { }, //登陆 async login() { + + if (!this.user) { + uni.showToast({ + title: '请输入用户名', + icon: 'none' + }) + return + } + if (!this.password1) { + uni.showToast({ + title: '请输入密码', + icon: 'none' + }) + return + } + + if (!this.loginType) { + uni.showToast({ + title: '请选择登陆类型', + icon: 'none' + }) + return + } + let item = {}; item['username'] = this.user item['password'] = this.password1 @@ -203,6 +227,22 @@ export default { this.loginType = e.value this.loginType_str = e.text this.picker_show_loginType = false + + //@todo 上线时请删除这个判断 + if(this.loginType == 1){ + //教师端 + this.user= '15374889135' //账户 + this.password1= '15374889135' //密码 + }else if(this.loginType == 2){ + //销售端 + this.user= '15148228108' //账户 + this.password1= '123123' //密码 + }else{ + //学生端 + this.user= '' //账户 + this.password1= '' //密码 + } + }, } }