|
@@ -550,11 +550,13 @@ export default {
|
|
|
|
|
|
// 荔园平台登录账号进行判断
|
|
// 荔园平台登录账号进行判断
|
|
if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
- // 暂时多余的一步,还是取荔园校区数组
|
|
|
|
|
|
+ // 能到这里就是有账户而且取到后缀了
|
|
|
|
+
|
|
|
|
+ // 暂时多余的一步,还是取荔园校区数组(新)
|
|
let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
let _list = this.allowOrgList[_index].list;
|
|
let _list = this.allowOrgList[_index].list;
|
|
if (
|
|
if (
|
|
- !_list.includes(this.OrgOptions[0].id)
|
|
|
|
|
|
+ !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
|
|
) {
|
|
) {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
// 账号不可登录,请使用您的专属网址
|
|
// 账号不可登录,请使用您的专属网址
|
|
@@ -565,10 +567,11 @@ export default {
|
|
// !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
|
|
// !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
|
|
// ) {
|
|
// ) {
|
|
// this.loading = false;
|
|
// this.loading = false;
|
|
- // 账号不可登录,请使用您的专属网址
|
|
|
|
|
|
+ // // 账号不可登录,请使用您的专属网址
|
|
// return this.$message.error(this.lang.Accountcannot);
|
|
// return this.$message.error(this.lang.Accountcannot);
|
|
// }
|
|
// }
|
|
} else {
|
|
} else {
|
|
|
|
+ // 这个是组织号登录时与账号登录只有一个时
|
|
// 非荔园登录时
|
|
// 非荔园登录时
|
|
// 取荔园校区list
|
|
// 取荔园校区list
|
|
let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
@@ -579,48 +582,20 @@ export default {
|
|
|
|
|
|
// 这一步是为了判断登录时,账户是否在组织下有账户问题(但现在获取账户时那部分已经被隐藏,多账号返回数字,这行代码没用了)
|
|
// 这一步是为了判断登录时,账户是否在组织下有账户问题(但现在获取账户时那部分已经被隐藏,多账号返回数字,这行代码没用了)
|
|
// if (this.OrgOptions.find((i) => i.Uorg == this.org)) {
|
|
// if (this.OrgOptions.find((i) => i.Uorg == this.org)) {
|
|
- if (mergedList.includes(this.OrgOptions[0].id)) {
|
|
|
|
|
|
+ // console.log('555',this.OrgOptions.find((i) => i.Uorg == this.org).id);
|
|
|
|
+ if (this.org && this.OrgOptions.find((i) => i.Uorg == this.org) && mergedList.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)) {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ // 账号不可登录,请使用您的专属网址
|
|
|
|
+ return this.$message.error(this.lang.Accountcannot);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!this.org && this.OrgOptions.find((i) => mergedList.includes(i.id)) && this.OrgOptions.find((i) => mergedList.includes(i.id)).id) {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
// 账号不可登录,请使用您的专属网址
|
|
// 账号不可登录,请使用您的专属网址
|
|
return this.$message.error(this.lang.Accountcannot);
|
|
return this.$message.error(this.lang.Accountcannot);
|
|
}
|
|
}
|
|
-
|
|
|
|
- // } else {
|
|
|
|
- // if (regEmail.test(str)) {
|
|
|
|
- // if (this.OrgOptions.find((i) => i.Uorg == str)) {
|
|
|
|
- // if (
|
|
|
|
- // mergedList.includes(
|
|
|
|
- // this.OrgOptions.find((i) => i.Uorg == str).id
|
|
|
|
- // )
|
|
|
|
- // ) {
|
|
|
|
- // this.loading = false;
|
|
|
|
- // // 账号不可登录,请使用您的专属网址
|
|
|
|
- // return this.$message.error(this.lang.Accountcannot);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // this.loading = false;
|
|
|
|
- // // 还未在此组织下创建账号,请先创建
|
|
|
|
- // return this.$message.error(this.lang.accountnotcreated);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- // let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
|
|
|
|
- // 组织号登录时,没有获取到后缀也没有手动填后缀(上面已经写过了)
|
|
|
|
- // if (!this.org && !regEmail.test(str)) {
|
|
|
|
- // // if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
|
|
- // // // 请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)
|
|
|
|
- // this.$message.error(this.lang.addsuffix);
|
|
|
|
- // // }
|
|
|
|
- // // else {
|
|
|
|
- // // // 该账号须使用“组织号登陆”
|
|
|
|
- // // this.$message.error(this.lang.accountmustOrg);
|
|
|
|
- // // this.loginType = "orgL";
|
|
|
|
- // // }
|
|
|
|
- // this.loading = false;
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
|
|
|
|
let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
|
|
let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
|
|
let email = "";
|
|
let email = "";
|
|
@@ -798,24 +773,6 @@ export default {
|
|
.post(API_CONFIG.baseUrl, params)
|
|
.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
console.log("res", res);
|
|
console.log("res", res);
|
|
- // 组织号登陆时不清空(this.org只有组织号赋值,还有登陆时ajax_liYuanAcc赋值,所以非组织号登录时要清空,让他在下面赋值)
|
|
|
|
- // if (this.loginType != "orgL") {
|
|
|
|
- // this.org = "";
|
|
|
|
- // }
|
|
|
|
- // this.OrgOptions = [];
|
|
|
|
-
|
|
|
|
- // let getList = res.data[0];
|
|
|
|
-
|
|
|
|
- // if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
|
|
- // let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
|
|
- // let _list = this.allowOrgList[_index].list;
|
|
|
|
- // getList = getList.filter((i) => _list.includes(i.id));
|
|
|
|
- // } else {
|
|
|
|
- // let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
|
|
- // return [...acc, ...curr.list];
|
|
|
|
- // }, []);
|
|
|
|
- // getList = getList.filter((i) => !mergedList.includes(i.id));
|
|
|
|
- // }
|
|
|
|
|
|
|
|
this.OrgOptions = res.data[0];
|
|
this.OrgOptions = res.data[0];
|
|
|
|
|
|
@@ -839,22 +796,33 @@ export default {
|
|
// 多账号时
|
|
// 多账号时
|
|
// liyuan走这里
|
|
// liyuan走这里
|
|
if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
- // try {
|
|
|
|
- // let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
|
|
- // let _list = this.allowOrgList[_index].list;
|
|
|
|
- // this.org = this.OrgOptions.filter((i) =>
|
|
|
|
- // _list.includes(i.id)
|
|
|
|
- // )[0].Uorg;
|
|
|
|
- // } catch (error) {
|
|
|
|
- // console.log(error);
|
|
|
|
- // this.loading = false
|
|
|
|
- // return this.$message.error(
|
|
|
|
- // this.lang.Accountcannot
|
|
|
|
- // );
|
|
|
|
- // }
|
|
|
|
|
|
+ // 有多个账号,但没有荔园的,就说明使用错网址了
|
|
|
|
+ if (this.OrgOptions[0].liyuannum == 0) {
|
|
|
|
+ this.$message.error(
|
|
|
|
+ // 账号不可登录,请使用您的专属网址
|
|
|
|
+ this.lang.Accountcannot
|
|
|
|
+ );
|
|
|
|
+ return resolve(2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 那这里就必有荔园账户了
|
|
|
|
+ try {
|
|
|
|
+ let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
|
|
+ let _list = this.allowOrgList[_index].list;
|
|
|
|
+ // 赋值后缀
|
|
|
|
+ this.org = this.OrgOptions.filter((i) =>
|
|
|
|
+ _list.includes(i.id)
|
|
|
|
+ )[0].Uorg;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$message.error(
|
|
|
|
+ this.lang.Accountcannot
|
|
|
|
+ );
|
|
|
|
+ return resolve(2);
|
|
|
|
+ }
|
|
|
|
|
|
- this.$message.error(this.lang.liyuanAccMore);
|
|
|
|
- return resolve(2);
|
|
|
|
|
|
+ // this.$message.error(this.lang.liyuanAccMore);
|
|
} else {
|
|
} else {
|
|
// admin走这里
|
|
// admin走这里
|
|
// let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
// let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
@@ -871,6 +839,14 @@ export default {
|
|
// this.lang.Accountcannot
|
|
// this.lang.Accountcannot
|
|
// );
|
|
// );
|
|
// }
|
|
// }
|
|
|
|
+ // if (this.OrgOptions[0].liyuannum != 0) {
|
|
|
|
+ // this.$message.error(
|
|
|
|
+ // // 账号不可登录,请使用您的专属网址
|
|
|
|
+ // this.lang.Accountcannot
|
|
|
|
+ // );
|
|
|
|
+ // return resolve(2);
|
|
|
|
+ // }
|
|
|
|
+
|
|
// 该账号须使用“组织号登陆”
|
|
// 该账号须使用“组织号登陆”
|
|
this.$message.error(this.lang.accountmustOrg);
|
|
this.$message.error(this.lang.accountmustOrg);
|
|
this.loginType = "orgL";
|
|
this.loginType = "orgL";
|
|
@@ -956,6 +932,7 @@ export default {
|
|
let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
let _index = this.allowOrgList.findIndex((i) => i.area);
|
|
let _list = this.allowOrgList[_index].list;
|
|
let _list = this.allowOrgList[_index].list;
|
|
if (!_list.includes(this.OrgOptions[0].id)) {
|
|
if (!_list.includes(this.OrgOptions[0].id)) {
|
|
|
|
+ // 账号不可登录,请使用您的专属网址
|
|
this.$message.error(this.lang.Accountcannot);
|
|
this.$message.error(this.lang.Accountcannot);
|
|
this.wechatLogin();
|
|
this.wechatLogin();
|
|
await loginOut();
|
|
await loginOut();
|
|
@@ -975,6 +952,7 @@ export default {
|
|
if (
|
|
if (
|
|
mergedList.includes(this.OrgOptions[0].id)
|
|
mergedList.includes(this.OrgOptions[0].id)
|
|
) {
|
|
) {
|
|
|
|
+ // 账号不可登录,请使用您的专属网址
|
|
this.$message.error(this.lang.Accountcannot);
|
|
this.$message.error(this.lang.Accountcannot);
|
|
this.wechatLogin();
|
|
this.wechatLogin();
|
|
await loginOut();
|
|
await loginOut();
|