|
@@ -184,7 +184,7 @@
|
|
<div
|
|
<div
|
|
style="width: 100%; display: flex; justify-content: flex-end"
|
|
style="width: 100%; display: flex; justify-content: flex-end"
|
|
>
|
|
>
|
|
- <el-button type="primary" @click="updatePassword"
|
|
|
|
|
|
+ <el-button type="primary" @click="updatePasswordL"
|
|
>保存</el-button
|
|
>保存</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
@@ -216,6 +216,8 @@ import avator from "../assets/info/teacher.jpg";
|
|
import { API_CONFIG } from "@/common/apiConfig";
|
|
import { API_CONFIG } from "@/common/apiConfig";
|
|
import { updatePassword, getUser } from "@/api/user";
|
|
import { updatePassword, getUser } from "@/api/user";
|
|
import store from "../store";
|
|
import store from "../store";
|
|
|
|
+import qs from "qs";
|
|
|
|
+import axios from "axios";
|
|
|
|
|
|
import "@/common/wxLogin.js";
|
|
import "@/common/wxLogin.js";
|
|
|
|
|
|
@@ -283,7 +285,7 @@ export default {
|
|
this.updateInfo();
|
|
this.updateInfo();
|
|
// this.getTypeInfo();
|
|
// this.getTypeInfo();
|
|
},
|
|
},
|
|
- updatePassword() {
|
|
|
|
|
|
+ updatePasswordL() {
|
|
const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,16}$/;
|
|
const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,16}$/;
|
|
if (!reg.test(this.password)) {
|
|
if (!reg.test(this.password)) {
|
|
this.$message.error("密码长度为8-16位,且包含大小写字母");
|
|
this.$message.error("密码长度为8-16位,且包含大小写字母");
|
|
@@ -640,24 +642,41 @@ export default {
|
|
}, 0);
|
|
}, 0);
|
|
},
|
|
},
|
|
setOpenId(openid) {
|
|
setOpenId(openid) {
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- functionName: API_CONFIG.ajax_UpdateOpenId.functionName, // 调用存储过程的名称
|
|
|
|
- uid: this.userid,
|
|
|
|
- openid: openid,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- this.$ajax
|
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
|
- .then(() => {
|
|
|
|
- this.$message.success("绑定成功");
|
|
|
|
- this.wechatDialogVisible = false;
|
|
|
|
- this.getData();
|
|
|
|
|
|
+ axios.defaults.withCredentials = false;
|
|
|
|
+ let params = {
|
|
|
|
+ openid: openid,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ this.openid = openid;
|
|
|
|
+ axios.defaults.withCredentials = true;
|
|
|
|
+ axios
|
|
|
|
+ .post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params))
|
|
|
|
+ .then(async (res) => {
|
|
|
|
+ let _data = res.data[0][0];
|
|
|
|
+ this.$message.error('该微信已绑定'+_data.username+'账号')
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
- this.$message.error("绑定失败请重新扫码");
|
|
|
|
- console.error(err);
|
|
|
|
- });
|
|
|
|
|
|
+ console.log('err',err);
|
|
|
|
+
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ functionName: API_CONFIG.ajax_UpdateOpenId.functionName, // 调用存储过程的名称
|
|
|
|
+ uid: this.userid,
|
|
|
|
+ openid: openid,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.$ajax
|
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$message.success("绑定成功");
|
|
|
|
+ this.wechatDialogVisible = false;
|
|
|
|
+ this.getData();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.$message.error("绑定失败请重新扫码");
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
Ochange() {
|
|
Ochange() {
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|