From b2eb196d0d011ff6fc16e1d98218bddd1cf3779c Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 8 Jun 2021 10:18:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/ClientLogin.vue | 4 ++-- src/components/page/Login.vue | 2 +- src/components/page/PersonalCenter.vue | 2 +- src/utils/api.js | 1 + src/utils/http.js | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/page/ClientLogin.vue b/src/components/page/ClientLogin.vue index 0c6a122..8e84bea 100644 --- a/src/components/page/ClientLogin.vue +++ b/src/components/page/ClientLogin.vue @@ -192,7 +192,7 @@ export default { schoolId: 2105, source: this.activeName }; - this.$get(this.api.loginSchool, data) + this.$post(this.api.loginSchool, data) .then(res => { if(res.status == 200){ this.schoolList = [...res.message.staffList,...res.message.studentList] @@ -231,7 +231,7 @@ export default { userId: this.userId, schoolId: this.schoolId }; - this.$get(this.api.loginRole, data) + this.$post(this.api.loginRole, data) .then(res => { this.roleList = [...res.message.staffList,...res.message.studentList] let indexs = {} diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue index bc2804c..fb8de77 100644 --- a/src/components/page/Login.vue +++ b/src/components/page/Login.vue @@ -82,7 +82,7 @@ export default { schoolId: 2105, source: 0 }; - this.$get(this.api.loginSchool, data).then(res => { + this.$post(this.api.loginSchool, data).then(res => { if(res.status == 200){ this.schoolList = [...res.message.staffList,...res.message.studentList] let indexs = {} diff --git a/src/components/page/PersonalCenter.vue b/src/components/page/PersonalCenter.vue index 0ea04cd..df34fbd 100644 --- a/src/components/page/PersonalCenter.vue +++ b/src/components/page/PersonalCenter.vue @@ -663,7 +663,7 @@ export default { if(!this.passwordForm.password) return this.$message.warning('请输入原密码') if(!this.passwordForm.newPassword) return this.$message.warning('请输入新密码') if(!this.passwordForm.reNewPassword) return this.$message.warning('请确认新密码') - if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return this.$message.warning('请输入6位数以上的密码') + if(!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,}$/.test(this.passwordForm.newPassword)) return this.$message.warning('密码必须包含数字、大小写字母,且至少六位') if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return this.$message.warning('输入的新密码不一致,请重新确认') if(this.passwordForm.password === this.passwordForm.newPassword) return this.$message.warning('原密码跟新密码不能一致') diff --git a/src/utils/api.js b/src/utils/api.js index 8cbd26f..6e778b2 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -3,6 +3,7 @@ // let host = 'http://192.168.31.137:9090'//陈 // let host = 'http://122.9.154.146' +// let host = 'http://192.168.242.218'//学校内网 let host = '' if(process.env.NODE_ENV === 'development'){ host = 'http://122.9.154.146' diff --git a/src/utils/http.js b/src/utils/http.js index fbc3bf1..fda649a 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -245,6 +245,7 @@ export function post(url, params) { this.$message.error( res.data.errmessage ); + reject(res.data) break; case 500: this.$message.error( From d63fcb4023c4a5e7179042a396cad9c715da9c26 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 9 Jun 2021 18:44:44 +0800 Subject: [PATCH 2/2] login --- src/components/page/Login.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue index fb8de77..37f43c7 100644 --- a/src/components/page/Login.vue +++ b/src/components/page/Login.vue @@ -95,6 +95,7 @@ export default { this.userId = this.schoolList[0].userId this.studentId = this.schoolList[0].studentId this.roleId = 4 + this.$store.commit("tokenData", {loginToken: res.message.loginToken}) let data = { roleId: 4,