|
@@ -15,10 +15,24 @@
|
|
</div>
|
|
</div>
|
|
<span>{{ showLoginMessage.name }}</span>
|
|
<span>{{ showLoginMessage.name }}</span>
|
|
</div>
|
|
</div>
|
|
- <span v-if="['default', 'weChat'].includes(loginType)">登录</span>
|
|
|
|
|
|
+ <span v-if="['default', 'weChat','orgL'].includes(loginType)">登录</span>
|
|
<span v-if="['bind'].includes(loginType)">绑定账号</span>
|
|
<span v-if="['bind'].includes(loginType)">绑定账号</span>
|
|
<div class="lp_r_b_formArea">
|
|
<div class="lp_r_b_formArea">
|
|
- <div class="fa_input" v-if="['default', 'bind'].includes(loginType)">
|
|
|
|
|
|
+ <div class="fa_input" v-if="['default', 'bind','orgL'].includes(loginType)">
|
|
|
|
+ <div class="fa_i_item" style="position: relative;" v-if="loginType == 'orgL'">
|
|
|
|
+ <span>组织号</span>
|
|
|
|
+ <div>
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ placeholder="请输入组织号"
|
|
|
|
+ v-model="SuffixData"
|
|
|
|
+ @input="getSuffix"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div style="border: none;font-size: 12px;position: absolute;left: 0;bottom: -70%;" v-if="SuffixData.trim()">
|
|
|
|
+ {{ orginfo.length ? orginfo[0].name :'该学校编号不存在' }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div class="fa_i_item">
|
|
<div class="fa_i_item">
|
|
<span>账号</span>
|
|
<span>账号</span>
|
|
<div>
|
|
<div>
|
|
@@ -78,7 +92,7 @@
|
|
|
|
|
|
<div
|
|
<div
|
|
class="lp_r_b_btn"
|
|
class="lp_r_b_btn"
|
|
- v-if="loginType == 'default'"
|
|
|
|
|
|
+ v-if="['default','orgL'].includes(loginType)"
|
|
@click="loginFn"
|
|
@click="loginFn"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
>
|
|
>
|
|
@@ -98,28 +112,41 @@
|
|
<div class="lp_r_b_btn" @click="loginType = 'default'">返回登录</div>
|
|
<div class="lp_r_b_btn" @click="loginType = 'default'">返回登录</div>
|
|
</div>
|
|
</div>
|
|
<div class="lp_r_b_line">
|
|
<div class="lp_r_b_line">
|
|
- <template v-if="['default', 'weChat'].includes(loginType)">
|
|
|
|
|
|
+ <template v-if="['default', 'weChat','orgL'].includes(loginType)">
|
|
<div></div>
|
|
<div></div>
|
|
<span>其他登录方式</span>
|
|
<span>其他登录方式</span>
|
|
<div></div>
|
|
<div></div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
<div class="lp_r_b_iconBtn">
|
|
<div class="lp_r_b_iconBtn">
|
|
|
|
+
|
|
|
|
+ <div
|
|
|
|
+ @click="loginType = 'orgL'"
|
|
|
|
+ v-if="['default', 'weChat','orgL'].includes(loginType)"
|
|
|
|
+ >
|
|
|
|
+ <el-tooltip effect="dark" content="组织号登录" placement="bottom">
|
|
|
|
+ <img :src="loginType == 'orgL' ? require('../../assets/login/zzl.svg') :require('../../assets/login/orgh.svg') "
|
|
|
|
+ :class="[loginType == 'orgL' ? 'backWin' : '']" />
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<div
|
|
<div
|
|
@click="wechatLogin"
|
|
@click="wechatLogin"
|
|
- v-if="['default', 'weChat'].includes(loginType)"
|
|
|
|
|
|
+ v-if="['default', 'weChat','orgL'].includes(loginType)"
|
|
>
|
|
>
|
|
<el-tooltip effect="dark" content="微信登录" placement="bottom">
|
|
<el-tooltip effect="dark" content="微信登录" placement="bottom">
|
|
- <img src="@/assets/login/wechat.svg" />
|
|
|
|
|
|
+ <img :src="loginType == 'weChat' ? require('../../assets/login/wxl.svg') :require('../../assets/login/wxh.svg') "
|
|
|
|
+ :class="[loginType == 'weChat' ? 'backWin' : '']" />
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div
|
|
<div
|
|
- @click="loginType = 'default'"
|
|
|
|
- v-if="['default', 'weChat'].includes(loginType)"
|
|
|
|
|
|
+ @click="loginType = 'default',SuffixData = ''"
|
|
|
|
+ v-if="['default', 'weChat','orgL'].includes(loginType)"
|
|
>
|
|
>
|
|
<el-tooltip effect="dark" content="账号密码登录" placement="bottom">
|
|
<el-tooltip effect="dark" content="账号密码登录" placement="bottom">
|
|
- <img src="@/assets/login/account.svg" />
|
|
|
|
|
|
+ <img :src="loginType == 'default' ? require('../../assets/login/zhl.svg') :require('../../assets/login/zhh.svg') "
|
|
|
|
+ :class="[loginType == 'default' ? 'backWin' : '']" />
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -135,6 +162,8 @@ import { API_CONFIG } from "@/common/apiConfig";
|
|
import "@/common/wxLogin";
|
|
import "@/common/wxLogin";
|
|
import { getUser } from "@/api/user";
|
|
import { getUser } from "@/api/user";
|
|
import { loginOut } from "@/api/user";
|
|
import { loginOut } from "@/api/user";
|
|
|
|
+import { GetSuffix } from "@/api/user";
|
|
|
|
+
|
|
import { myMixin } from "@/mixins/mixin.js"
|
|
import { myMixin } from "@/mixins/mixin.js"
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -142,6 +171,12 @@ export default {
|
|
name: "loginPage",
|
|
name: "loginPage",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ // 判断显示组织号区域
|
|
|
|
+ SuffixShow: false,
|
|
|
|
+ // 组织号查询区域结果
|
|
|
|
+ SuffixData:'',
|
|
|
|
+ orginfo:[],
|
|
|
|
+ // 后缀
|
|
org: "",
|
|
org: "",
|
|
account: "",
|
|
account: "",
|
|
password: "",
|
|
password: "",
|
|
@@ -214,9 +249,24 @@ export default {
|
|
login: "user/login",
|
|
login: "user/login",
|
|
logout: "user/logout",
|
|
logout: "user/logout",
|
|
}),
|
|
}),
|
|
|
|
+ // 获取组织后缀
|
|
|
|
+ async getSuffix(){
|
|
|
|
+ let res = await GetSuffix({mode: this.SuffixData})
|
|
|
|
+ console.log('res.data[0]',res.data[0]);
|
|
|
|
+
|
|
|
|
+ if (res.data[0].length) {
|
|
|
|
+ this.orginfo = res.data[0]
|
|
|
|
+ this.org = this.orginfo[0].mail
|
|
|
|
+ }else{
|
|
|
|
+ this.orginfo = []
|
|
|
|
+ this.org = ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async loginFn() {
|
|
async loginFn() {
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
- await this.getOrgData();
|
|
|
|
|
|
+ if (this.loginType != 'orgL') {
|
|
|
|
+ await this.getOrgData();
|
|
|
|
+ }
|
|
|
|
|
|
const regEmail = new RegExp(
|
|
const regEmail = new RegExp(
|
|
"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
|
|
"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
|
|
@@ -232,11 +282,15 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
|
|
let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
|
|
-
|
|
|
|
if (!this.org && !regEmail.test(str)) {
|
|
if (!this.org && !regEmail.test(str)) {
|
|
- return this.$message.error(
|
|
|
|
- "请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
|
|
|
|
|
|
+ // this.$message.error(
|
|
|
|
+ // "请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
|
|
|
|
+ // );
|
|
|
|
+ this.$message.error(
|
|
|
|
+ "登录失败,请输入组织号"
|
|
);
|
|
);
|
|
|
|
+ this.loginType = 'orgL'
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
if (this.allowOrgList.findIndex((i) => i.area) != -1) {
|
|
@@ -244,7 +298,7 @@ export default {
|
|
let _list = this.allowOrgList[_index].list;
|
|
let _list = this.allowOrgList[_index].list;
|
|
if (this.OrgOptions.find((i) => i.Uorg == this.org) && !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
|
|
if (this.OrgOptions.find((i) => i.Uorg == this.org) && !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
|
|
) {
|
|
) {
|
|
- return this.$message.error("账号不可登陆,请联系管理员。");
|
|
|
|
|
|
+ return this.$message.error("账号不可使用,请使用您的专属网站。");
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
let mergedList = this.allowOrgList.reduce((acc, curr) => {
|
|
@@ -255,7 +309,7 @@ export default {
|
|
this.OrgOptions.find((i) => i.Uorg == this.org).id
|
|
this.OrgOptions.find((i) => i.Uorg == this.org).id
|
|
)
|
|
)
|
|
) {
|
|
) {
|
|
- return this.$message.error("账号不可登陆,请联系管理员。");
|
|
|
|
|
|
+ return this.$message.error("账号不可使用,请使用您的专属网站。");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -849,4 +903,7 @@ export default {
|
|
display: flex;
|
|
display: flex;
|
|
gap: 10px;
|
|
gap: 10px;
|
|
}
|
|
}
|
|
|
|
+.backWin{
|
|
|
|
+ /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); */
|
|
|
|
+}
|
|
</style>
|
|
</style>
|