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..37f43c7 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 = {} @@ -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, 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 3221d7c..dc34fcf 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -4,6 +4,7 @@ // let host = 'http://192.168.31.205: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(