|
@@ -400,6 +400,11 @@ export default {
|
|
|
_result.logo = _obj.logo;
|
|
|
}
|
|
|
|
|
|
+ return _result;
|
|
|
+ },
|
|
|
+ userRequest() {
|
|
|
+ let _result = this.$region == 'hk' ? 'https://cloud.api.cocorobo.hk/api/user' : 'https://beta.api.cocorobo.cn/api/user'
|
|
|
+
|
|
|
return _result;
|
|
|
},
|
|
|
},
|
|
@@ -477,23 +482,32 @@ export default {
|
|
|
},
|
|
|
async loginFn() {
|
|
|
if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
// loginType == orgL为组织号登录
|
|
|
- if (this.loginType == "orgL" && !this.org)
|
|
|
+ if (this.loginType == "orgL" && !this.org){
|
|
|
+ this.loading = false;
|
|
|
return this.$message.error(this.lang.enterorgnumber);
|
|
|
+ }
|
|
|
|
|
|
// if (this.loginType != 'orgL') {
|
|
|
- if ((await this.getOrgData()) == 2) return (this.loginType = "orgL");
|
|
|
+ if ((await this.getOrgData()) == 2){
|
|
|
+ this.loading = false;
|
|
|
+ return (this.loginType = "orgL");
|
|
|
+ }
|
|
|
// }
|
|
|
const regEmail = new RegExp(
|
|
|
"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
|
|
|
);
|
|
|
if (this.account.length <= 0) {
|
|
|
this.$message.error(this.lang.enteraccount);
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (this.password.length < 6 || /[\u4e00-\u9fa5]/.test(this.password)) {
|
|
|
this.$message.error(this.lang.passwordlength);
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -505,6 +519,7 @@ export default {
|
|
|
this.OrgOptions.find((i) => i.Uorg == this.org) &&
|
|
|
!_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
|
|
|
) {
|
|
|
+ this.loading = false;
|
|
|
return this.$message.error(this.lang.Accountcannot);
|
|
|
}
|
|
|
} else {
|
|
@@ -518,9 +533,11 @@ export default {
|
|
|
this.OrgOptions.find((i) => i.Uorg == this.org).id
|
|
|
)
|
|
|
) {
|
|
|
+ this.loading = false;
|
|
|
return this.$message.error(this.lang.Accountcannot);
|
|
|
}
|
|
|
} else {
|
|
|
+ this.loading = false;
|
|
|
return this.$message.error(this.lang.accountnotcreated);
|
|
|
}
|
|
|
}
|
|
@@ -539,6 +556,7 @@ export default {
|
|
|
this.$message.error(this.lang.accountmustOrg);
|
|
|
this.loginType = "orgL";
|
|
|
}
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -559,12 +577,11 @@ export default {
|
|
|
loginUsername: email.trim(),
|
|
|
loginPassword: window.btoa(this.password.trim()),
|
|
|
};
|
|
|
- this.loading = true;
|
|
|
axios.defaults.withCredentials = true;
|
|
|
console.log("👇", this.prefixL);
|
|
|
// this.addOp3('1', "", { type:this.prefixL + "login" }, "success",'0c3735c9-a2ef-11ef-9b30-005056b86db5')
|
|
|
axios
|
|
|
- .post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
|
|
|
+ .post(this.userRequest, qs.stringify(params))
|
|
|
.then(async (res) => {
|
|
|
console.log("res", res);
|
|
|
let _data = res.data[0][0];
|
|
@@ -622,10 +639,12 @@ export default {
|
|
|
]);
|
|
|
if (!data.data[0].length) {
|
|
|
this.$message.error(this.lang.Nocoracc);
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
if (data.data[0][0].thirdpartyid) {
|
|
|
this.$message.error(this.lang.hasbeenlinked);
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -640,7 +659,7 @@ export default {
|
|
|
axios.defaults.withCredentials = true;
|
|
|
console.log("👇进入进行微信绑定环节");
|
|
|
axios
|
|
|
- .post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
|
|
|
+ .post(this.userRequest, qs.stringify(params))
|
|
|
.then(async (res) => {
|
|
|
console.log("res", res);
|
|
|
let _data = res.data[0][0];
|
|
@@ -843,7 +862,7 @@ export default {
|
|
|
this.openid = openid;
|
|
|
axios.defaults.withCredentials = true;
|
|
|
axios
|
|
|
- .post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params))
|
|
|
+ .post(this.userRequest, qs.stringify(params))
|
|
|
.then(async (res) => {
|
|
|
console.log("res", res);
|
|
|
let _data = res.data[0][0];
|
|
@@ -976,7 +995,6 @@ export default {
|
|
|
this.$ajax
|
|
|
.post(API_CONFIG.baseUrl, params)
|
|
|
.then((res) => {
|
|
|
- // this.loading = false;
|
|
|
if (res.data.length && res.data[0].length) {
|
|
|
this.res = res.data[0][0];
|
|
|
this.courseId = res.data[0][0].courseId;
|
|
@@ -991,11 +1009,6 @@ export default {
|
|
|
},
|
|
|
// 根据随机码获取学生
|
|
|
getClass(classId) {
|
|
|
- // let params = {
|
|
|
- // cid: classId,
|
|
|
- // };
|
|
|
- // this.ajax
|
|
|
- // .get(this.$store.state.api + "selectSnameByCid", params)
|
|
|
let params = [
|
|
|
{
|
|
|
functionName: API_CONFIG.ajax_selectSnameByCid.functionName, // 调用存储过程的名称
|
|
@@ -1048,7 +1061,7 @@ export default {
|
|
|
};
|
|
|
axios.defaults.withCredentials = true;
|
|
|
axios
|
|
|
- .post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
|
|
|
+ .post(this.userRequest, qs.stringify(params))
|
|
|
.then(async (res) => {
|
|
|
console.log("res", res);
|
|
|
this.loading = false;
|