|
|
@ -4,37 +4,63 @@ |
|
|
|
<div class="form"> |
|
|
|
<div class="form"> |
|
|
|
<h6 class="title">欢迎使用请登录</h6> |
|
|
|
<h6 class="title">欢迎使用请登录</h6> |
|
|
|
<ul class="tab"> |
|
|
|
<ul class="tab"> |
|
|
|
<li v-for="(item,index) in tabList" :key="index" :class="{active: form.distinguish == item.id}" @click="typeClick(item)">{{item.label}}</li> |
|
|
|
<li v-for="(item,index) in tabList" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:class="{active: form.distinguish == item.id}" |
|
|
|
|
|
|
|
@click="typeClick(item)">{{item.label}}</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<el-form :model="form" :rules="rules" ref="form" style="margin-top: 20px"> |
|
|
|
<el-form :model="form" |
|
|
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
|
|
ref="form" |
|
|
|
|
|
|
|
style="margin-top: 20px"> |
|
|
|
<!-- 学号工号 --> |
|
|
|
<!-- 学号工号 --> |
|
|
|
<div v-show="!form.distinguish"> |
|
|
|
<div v-show="!form.distinguish"> |
|
|
|
<el-form-item class="school-select" prop="schoolId"> |
|
|
|
<el-form-item class="school-select" |
|
|
|
|
|
|
|
prop="schoolId"> |
|
|
|
<label class="label school"></label> |
|
|
|
<label class="label school"></label> |
|
|
|
<el-select v-model="form.schoolId" clearable filterable placeholder="请选择学校"> |
|
|
|
<el-select v-model="form.schoolId" |
|
|
|
<el-option v-for="(item, i) in schoolList" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option> |
|
|
|
clearable |
|
|
|
|
|
|
|
filterable |
|
|
|
|
|
|
|
placeholder="请选择学校"> |
|
|
|
|
|
|
|
<el-option v-for="(item, i) in schoolList" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
:label="item.schoolName" |
|
|
|
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="flex-1" prop="workNumber"> |
|
|
|
<el-form-item class="flex-1" |
|
|
|
|
|
|
|
prop="workNumber"> |
|
|
|
<label class="label account"></label> |
|
|
|
<label class="label account"></label> |
|
|
|
<el-input v-model.trim="form.workNumber" :placeholder="'请输入学号/工号'" @keyup.enter.native="submit"></el-input> |
|
|
|
<el-input v-model.trim="form.workNumber" |
|
|
|
|
|
|
|
:placeholder="'请输入学号/工号'" |
|
|
|
|
|
|
|
@keyup.enter.native="submit"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 手机号登录 --> |
|
|
|
<!-- 手机号登录 --> |
|
|
|
<el-form-item v-show="form.distinguish === 1" prop="account"> |
|
|
|
<el-form-item v-show="form.distinguish === 1" |
|
|
|
|
|
|
|
prop="account"> |
|
|
|
<label class="label account"></label> |
|
|
|
<label class="label account"></label> |
|
|
|
<el-input v-model.trim="form.account" placeholder="请输入账号" @keyup.enter.native="submit"></el-input> |
|
|
|
<el-input v-model.trim="form.account" |
|
|
|
|
|
|
|
placeholder="请输入账号" |
|
|
|
|
|
|
|
@keyup.enter.native="submit"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<template v-if="form.distinguish === 2"> |
|
|
|
<template v-if="form.distinguish === 2"> |
|
|
|
<el-form-item prop="account"> |
|
|
|
<el-form-item prop="account"> |
|
|
|
<label class="label account"></label> |
|
|
|
<label class="label account"></label> |
|
|
|
<el-input v-model.trim="form.account" placeholder="请输入手机号/邮箱" @keyup.enter.native="submit"></el-input> |
|
|
|
<el-input v-model.trim="form.account" |
|
|
|
|
|
|
|
placeholder="请输入手机号/邮箱" |
|
|
|
|
|
|
|
@keyup.enter.native="submit"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="code"> |
|
|
|
<el-form-item prop="code"> |
|
|
|
<label class="label code"></label> |
|
|
|
<label class="label code"></label> |
|
|
|
<div class="ver-code"> |
|
|
|
<div class="ver-code"> |
|
|
|
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6" @keyup.enter.native="submit"></el-input> |
|
|
|
<el-input v-model="form.code" |
|
|
|
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }} |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
maxlength="6" |
|
|
|
|
|
|
|
@keyup.enter.native="submit"></el-input> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="sendPhoneCodeLogin" |
|
|
|
|
|
|
|
:disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }} |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -42,61 +68,89 @@ |
|
|
|
<template v-if="form.distinguish !== 2"> |
|
|
|
<template v-if="form.distinguish !== 2"> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<label class="password label"></label> |
|
|
|
<label class="password label"></label> |
|
|
|
<el-input |
|
|
|
<el-input type="password" |
|
|
|
type="password" |
|
|
|
|
|
|
|
placeholder="请输入密码" |
|
|
|
placeholder="请输入密码" |
|
|
|
v-model.trim="form.password" |
|
|
|
v-model.trim="form.password" |
|
|
|
@keyup.enter.native="submit" |
|
|
|
@keyup.enter.native="submit"> |
|
|
|
> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="code"> |
|
|
|
<el-form-item prop="code"> |
|
|
|
<label class="label code"></label> |
|
|
|
<label class="label code"></label> |
|
|
|
<el-input |
|
|
|
<el-input placeholder="请输入验证码" |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
v-model.trim="form.code" |
|
|
|
v-model.trim="form.code" |
|
|
|
@keyup.enter.native="submit" |
|
|
|
@keyup.enter.native="submit"> |
|
|
|
> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
<img @click="getVerImg" :src="verificationIMG" class="ver-img" alt=""> |
|
|
|
<img @click="getVerImg" |
|
|
|
|
|
|
|
:src="verificationIMG" |
|
|
|
|
|
|
|
class="ver-img" |
|
|
|
|
|
|
|
alt=""> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<div v-show="!form.distinguish" class="default-check"> |
|
|
|
<div v-show="!form.distinguish" |
|
|
|
|
|
|
|
class="default-check"> |
|
|
|
<el-checkbox v-model="setDefault">设置为默认学校</el-checkbox> |
|
|
|
<el-checkbox v-model="setDefault">设置为默认学校</el-checkbox> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-button class="submit" type="primary" @click="submit">登录</el-button> |
|
|
|
<el-button class="submit" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="submit">登录</el-button> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="576px"> |
|
|
|
<el-dialog title="绑定手机号" |
|
|
|
|
|
|
|
:visible.sync="phoneVisible" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
width="576px"> |
|
|
|
<p class="tips">依据国家政策法规,需绑定手机号进行网络实名才可登录使用本平台</p> |
|
|
|
<p class="tips">依据国家政策法规,需绑定手机号进行网络实名才可登录使用本平台</p> |
|
|
|
<el-form label-width="60px"> |
|
|
|
<el-form label-width="60px"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11" @change="phoneChange"></el-input> |
|
|
|
<el-input placeholder="请输入手机号" |
|
|
|
|
|
|
|
v-model="phone" |
|
|
|
|
|
|
|
maxlength="11" |
|
|
|
|
|
|
|
@change="phoneChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<div class="ver-code"> |
|
|
|
<div class="ver-code"> |
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-input v-model="phoneCode" |
|
|
|
<el-button style="top: 1px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
maxlength="6"></el-input> |
|
|
|
|
|
|
|
<el-button style="top: 1px" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="sendPhoneCode(1)" |
|
|
|
|
|
|
|
:disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" @click="phoneVisible = false">取 消</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="phoneSubmit">确 定</el-button> |
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="phoneVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="phoneSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia" width="500px"> |
|
|
|
<el-dialog title="请选择您要登录的用户" |
|
|
|
|
|
|
|
:visible.sync="userVisible" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
custom-class="user-dia" |
|
|
|
|
|
|
|
width="500px"> |
|
|
|
<p class="tips">该手机号已绑定以下用户信息</p> |
|
|
|
<p class="tips">该手机号已绑定以下用户信息</p> |
|
|
|
<ul class="users"> |
|
|
|
<ul class="users"> |
|
|
|
<li :class="{isEnable: !user.isEnable}" v-for="(user, i) in users" :key="i" @click="chooseUser(user)"> |
|
|
|
<li :class="{isEnable: !user.isEnable}" |
|
|
|
|
|
|
|
v-for="(user, i) in users" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
@click="chooseUser(user)"> |
|
|
|
<span>{{ user.schoolName }},{{ user.userName }},{{ user.workNumber }}{{ user.isEnable ? '' : '(已禁用)'}}</span> |
|
|
|
<span>{{ user.schoolName }},{{ user.userName }},{{ user.workNumber }}{{ user.isEnable ? '' : '(已禁用)'}}</span> |
|
|
|
<i class="el-icon-right"></i> |
|
|
|
<i class="el-icon-right"></i> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" :show-close="false" custom-class="info-dia" width="400px"> |
|
|
|
<el-dialog :visible.sync="infoVisible" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
:show-close="false" |
|
|
|
|
|
|
|
custom-class="info-dia" |
|
|
|
|
|
|
|
width="400px"> |
|
|
|
<div class="info-header"> |
|
|
|
<div class="info-header"> |
|
|
|
<i class="el-icon-warning"></i> |
|
|
|
<i class="el-icon-warning"></i> |
|
|
|
提示 |
|
|
|
提示 |
|
|
@ -104,20 +158,26 @@ |
|
|
|
<div class="info-wrap"> |
|
|
|
<div class="info-wrap"> |
|
|
|
<p class="tips">该手机号已与以下用户绑定</p> |
|
|
|
<p class="tips">该手机号已与以下用户绑定</p> |
|
|
|
<ul class="users"> |
|
|
|
<ul class="users"> |
|
|
|
<li v-for="(user, i) in infos" :key="i"> |
|
|
|
<li v-for="(user, i) in infos" |
|
|
|
|
|
|
|
:key="i"> |
|
|
|
<span>{{ user.userName }}({{ user.schoolName }})</span> |
|
|
|
<span>{{ user.userName }}({{ user.schoolName }})</span> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<div class="info-footer"> |
|
|
|
<div class="info-footer"> |
|
|
|
<el-button size="small" type="primary" @click="bindPhone">是本人,继续绑定</el-button> |
|
|
|
<el-button size="small" |
|
|
|
<el-button class="unbind" size="small" @click="unbindPhone">不是本人,解绑以上用户并绑定新用户</el-button> |
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="bindPhone">是本人,继续绑定</el-button> |
|
|
|
|
|
|
|
<el-button class="unbind" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
@click="unbindPhone">不是本人,解绑以上用户并绑定新用户</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<div class="footer"> |
|
|
|
<div class="footer"> |
|
|
|
<div class="copyright"> |
|
|
|
<div class="copyright"> |
|
|
|
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a> |
|
|
|
<a href="https://beian.miit.gov.cn/#/Integrated/index" |
|
|
|
|
|
|
|
target="_blank">粤ICP备20072679号</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -131,7 +191,7 @@ import util from '@/libs/util' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
import vFooter from '@/layouts/footer' |
|
|
|
import vFooter from '@/layouts/footer' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data: function() { |
|
|
|
data: function () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
tabList: [ |
|
|
|
tabList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -186,8 +246,8 @@ export default { |
|
|
|
infos: [] |
|
|
|
infos: [] |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: {vHead,vFooter}, |
|
|
|
components: { vHead, vFooter }, |
|
|
|
mounted(){ |
|
|
|
mounted () { |
|
|
|
this.getSchool() |
|
|
|
this.getSchool() |
|
|
|
this.getVerImg() |
|
|
|
this.getVerImg() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -199,23 +259,23 @@ export default { |
|
|
|
'login', 'setCustomer' |
|
|
|
'login', 'setCustomer' |
|
|
|
]), |
|
|
|
]), |
|
|
|
// 赋值学校列表及id |
|
|
|
// 赋值学校列表及id |
|
|
|
setSchool(list) { |
|
|
|
setSchool (list) { |
|
|
|
this.schoolList = list |
|
|
|
this.schoolList = list |
|
|
|
// 取本地缓存里的学校id |
|
|
|
// 取本地缓存里的学校id |
|
|
|
const schoolId = util.local.get(schoolIdKey) |
|
|
|
const schoolId = util.local.get(schoolIdKey) |
|
|
|
if (schoolId) this.form.schoolId = schoolId |
|
|
|
if (schoolId) this.form.schoolId = schoolId |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取学校列表 |
|
|
|
// 获取学校列表 |
|
|
|
getSchool() { |
|
|
|
getSchool () { |
|
|
|
this.$get(this.api.querySchool, { |
|
|
|
this.$get(this.api.querySchool, { |
|
|
|
provinceId: '', |
|
|
|
provinceId: '', |
|
|
|
cityId: '' |
|
|
|
cityId: '' |
|
|
|
}).then(({ list }) => { |
|
|
|
}).then(({ list }) => { |
|
|
|
this.setSchool(list) |
|
|
|
this.setSchool(list) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 切换标签 |
|
|
|
// 切换标签 |
|
|
|
typeClick(tab) { |
|
|
|
typeClick (tab) { |
|
|
|
const { id } = tab |
|
|
|
const { id } = tab |
|
|
|
const form = this.form |
|
|
|
const form = this.form |
|
|
|
// 切换了后,全部字段重置 |
|
|
|
// 切换了后,全部字段重置 |
|
|
@ -241,14 +301,14 @@ export default { |
|
|
|
'请输入手机号/邮箱' |
|
|
|
'请输入手机号/邮箱' |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 选择用户回调 |
|
|
|
// 选择用户回调 |
|
|
|
chooseUser(user) { |
|
|
|
chooseUser (user) { |
|
|
|
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => { |
|
|
|
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => { |
|
|
|
this.token = data.token |
|
|
|
this.token = data.token |
|
|
|
this.setLogin() |
|
|
|
this.setLogin() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 处理登录成功 |
|
|
|
// 处理登录成功 |
|
|
|
setLogin() { |
|
|
|
setLogin () { |
|
|
|
util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires) |
|
|
|
util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires) |
|
|
|
// 查询是否是客户,如果是客户,则弹出选择端的页面去选择跳转到哪个端 |
|
|
|
// 查询是否是客户,如果是客户,则弹出选择端的页面去选择跳转到哪个端 |
|
|
|
this.$get(this.api.isClient).then(res => { |
|
|
|
this.$get(this.api.isClient).then(res => { |
|
|
@ -259,20 +319,20 @@ export default { |
|
|
|
userName |
|
|
|
userName |
|
|
|
}) |
|
|
|
}) |
|
|
|
window.opener && window.opener.location.reload() // 刷新官网 |
|
|
|
window.opener && window.opener.location.reload() // 刷新官网 |
|
|
|
util.local.set(Setting.storeKey,this.$store.state) |
|
|
|
util.local.set(Setting.storeKey, this.$store.state) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
// 查询schoolId |
|
|
|
// 查询schoolId |
|
|
|
this.$post(this.api.getSchoolIdByToken).then(res => { |
|
|
|
this.$post(this.api.getSchoolIdByToken).then(res => { |
|
|
|
this.SET_INFO(res) |
|
|
|
this.SET_INFO(res) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
// 登录次数+1 |
|
|
|
// 登录次数+1 |
|
|
|
this.$post(this.api.saveRecord,{ |
|
|
|
this.$post(this.api.saveRecord, { |
|
|
|
type: 3, |
|
|
|
type: 3, |
|
|
|
}).then(res => {}).catch(res => {}) |
|
|
|
}).then(res => { }).catch(res => { }) |
|
|
|
util.successMsg('登录成功') |
|
|
|
util.successMsg('登录成功') |
|
|
|
this.$router.replace('/index') |
|
|
|
this.$router.replace('/index') |
|
|
|
}, |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
submit () { |
|
|
|
this.$refs.form.validate(valid => { |
|
|
|
this.$refs.form.validate(valid => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
@ -302,19 +362,23 @@ export default { |
|
|
|
this.setLogin() |
|
|
|
this.setLogin() |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
form.code = '' |
|
|
|
util.errorMsg(message) |
|
|
|
util.errorMsg(message) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
this.getVerImg() |
|
|
|
|
|
|
|
form.code = '' |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getVerImg(){ |
|
|
|
getVerImg () { |
|
|
|
this.form.random = Math.floor(Math.random()*999999999) |
|
|
|
this.form.random = Math.floor(Math.random() * 999999999) |
|
|
|
this.verificationIMG = this.api.verification+'?random='+`${this.form.random}` |
|
|
|
this.verificationIMG = this.api.verification + '?random=' + `${this.form.random}` |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 验证手机号 |
|
|
|
// 验证手机号 |
|
|
|
verifyPhone(phone) { |
|
|
|
verifyPhone (phone) { |
|
|
|
if (!phone) { |
|
|
|
if (!phone) { |
|
|
|
this.$message.error("请输入手机号") |
|
|
|
this.$message.error("请输入手机号") |
|
|
|
return false |
|
|
|
return false |
|
|
@ -327,7 +391,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 验证码倒计时 |
|
|
|
// 验证码倒计时 |
|
|
|
phoneCountdownLogin() { |
|
|
|
phoneCountdownLogin () { |
|
|
|
let count = 60 |
|
|
|
let count = 60 |
|
|
|
if (!this.phoneTimerLogin) { |
|
|
|
if (!this.phoneTimerLogin) { |
|
|
|
this.phoneDisabledLogin = true |
|
|
|
this.phoneDisabledLogin = true |
|
|
@ -345,28 +409,28 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发送验证码 |
|
|
|
// 发送验证码 |
|
|
|
sendPhoneCodeLogin() { |
|
|
|
sendPhoneCodeLogin () { |
|
|
|
const phone = this.form.account |
|
|
|
const phone = this.form.account |
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${Setting.platformId}`).then(({ message }) => { |
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${Setting.platformId}`).then(({ message }) => { |
|
|
|
util.successMsg(message) |
|
|
|
util.successMsg(message) |
|
|
|
this.phoneCountdownLogin() |
|
|
|
this.phoneCountdownLogin() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 继续绑定 |
|
|
|
// 继续绑定 |
|
|
|
bindPhone() { |
|
|
|
bindPhone () { |
|
|
|
this.infoVisible = false |
|
|
|
this.infoVisible = false |
|
|
|
this.binding = true |
|
|
|
this.binding = true |
|
|
|
this.sendPhoneCode(1) |
|
|
|
this.sendPhoneCode(1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 解除绑定 |
|
|
|
// 解除绑定 |
|
|
|
unbindPhone() { |
|
|
|
unbindPhone () { |
|
|
|
this.infoVisible = false |
|
|
|
this.infoVisible = false |
|
|
|
this.binding = false |
|
|
|
this.binding = false |
|
|
|
this.sendPhoneCode(0) |
|
|
|
this.sendPhoneCode(0) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 手机号失去焦点回调 |
|
|
|
// 手机号失去焦点回调 |
|
|
|
phoneChange() { |
|
|
|
phoneChange () { |
|
|
|
this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => { |
|
|
|
this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => { |
|
|
|
const list = userAccounts |
|
|
|
const list = userAccounts |
|
|
|
if (list) { |
|
|
|
if (list) { |
|
|
@ -380,29 +444,29 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.binding = true |
|
|
|
this.binding = true |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
phoneCountdown(){ |
|
|
|
phoneCountdown () { |
|
|
|
let count = 60 |
|
|
|
let count = 60 |
|
|
|
if(!this.phoneTimer){ |
|
|
|
if (!this.phoneTimer) { |
|
|
|
this.phoneDisabled = true |
|
|
|
this.phoneDisabled = true |
|
|
|
this.phoneTimer = setInterval(() => { |
|
|
|
this.phoneTimer = setInterval(() => { |
|
|
|
console.log('倒计时中') |
|
|
|
console.log('倒计时中') |
|
|
|
if(count > 0){ |
|
|
|
if (count > 0) { |
|
|
|
count-- |
|
|
|
count-- |
|
|
|
this.phoneBtnText = `${count}秒后重试` |
|
|
|
this.phoneBtnText = `${count}秒后重试` |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.phoneDisabled = false |
|
|
|
this.phoneDisabled = false |
|
|
|
clearInterval(this.phoneTimer) |
|
|
|
clearInterval(this.phoneTimer) |
|
|
|
this.phoneTimer = null |
|
|
|
this.phoneTimer = null |
|
|
|
this.phoneBtnText = `发送验证码` |
|
|
|
this.phoneBtnText = `发送验证码` |
|
|
|
} |
|
|
|
} |
|
|
|
},1000) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发送验证码 |
|
|
|
// 发送验证码 |
|
|
|
sendPhoneCode(bind) { |
|
|
|
sendPhoneCode (bind) { |
|
|
|
const { phone } = this |
|
|
|
const { phone } = this |
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
// 不解绑发送验证码 |
|
|
|
// 不解绑发送验证码 |
|
|
@ -418,16 +482,16 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
util.errorMsg(message) |
|
|
|
util.errorMsg(message) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=1&platform=${Setting.platformId}`).then(({ message }) => { |
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=1&platform=${Setting.platformId}`).then(({ message }) => { |
|
|
|
util.successMsg(message) |
|
|
|
util.successMsg(message) |
|
|
|
this.phoneCountdown() |
|
|
|
this.phoneCountdown() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 解绑 |
|
|
|
// 解绑 |
|
|
|
unbind() { |
|
|
|
unbind () { |
|
|
|
const { password, platform, schoolId, type, workNumber } = this.form |
|
|
|
const { password, platform, schoolId, type, workNumber } = this.form |
|
|
|
this.$post(this.api.unbindAccounts, { |
|
|
|
this.$post(this.api.unbindAccounts, { |
|
|
|
accountIds: this.accountIds, |
|
|
|
accountIds: this.accountIds, |
|
|
@ -441,10 +505,10 @@ export default { |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.token = data.token |
|
|
|
this.token = data.token |
|
|
|
this.setLogin() |
|
|
|
this.setLogin() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 绑定手机号 |
|
|
|
// 绑定手机号 |
|
|
|
phoneSubmit() { |
|
|
|
phoneSubmit () { |
|
|
|
const { phone, phoneCode } = this |
|
|
|
const { phone, phoneCode } = this |
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
if (!phoneCode) return util.warningMsg('请输入验证码') |
|
|
|
if (!phoneCode) return util.warningMsg('请输入验证码') |
|
|
@ -462,7 +526,7 @@ export default { |
|
|
|
}).then(({ token }) => { |
|
|
|
}).then(({ token }) => { |
|
|
|
this.token = token |
|
|
|
this.token = token |
|
|
|
this.setLogin() |
|
|
|
this.setLogin() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.unbind() |
|
|
|
this.unbind() |
|
|
|
} |
|
|
|
} |
|
|
@ -474,7 +538,7 @@ export default { |
|
|
|
<style scoped lang="scss"> |
|
|
|
<style scoped lang="scss"> |
|
|
|
.wrap { |
|
|
|
.wrap { |
|
|
|
min-height: 100%; |
|
|
|
min-height: 100%; |
|
|
|
background-color: #F3F6FA; |
|
|
|
background-color: #f3f6fa; |
|
|
|
} |
|
|
|
} |
|
|
|
.ver-code { |
|
|
|
.ver-code { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
@ -484,33 +548,33 @@ export default { |
|
|
|
right: 10px; |
|
|
|
right: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.login{ |
|
|
|
.login { |
|
|
|
min-height: calc(100vh - 70px); |
|
|
|
min-height: calc(100vh - 70px); |
|
|
|
padding-top: calc((100vh - 611px) / 2); |
|
|
|
padding-top: calc((100vh - 611px) / 2); |
|
|
|
background: url(../../../assets/img/shapes/shape1.png) (0 123px)/auto no-repeat, |
|
|
|
background: url(../../../assets/img/shapes/shape1.png) (0 123px) / auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape2.png) (35px 238px)/auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape2.png) (35px 238px) / auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape3.png) (0 485px)/auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape3.png) (0 485px) / auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape4.png) (right 50%)/auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape4.png) (right 50%) / auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape5.png) (right 80%)/auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape5.png) (right 80%) / auto no-repeat, |
|
|
|
url(../../../assets/img/shapes/shape6.png) (right bottom)/auto no-repeat; |
|
|
|
url(../../../assets/img/shapes/shape6.png) (right bottom) / auto no-repeat; |
|
|
|
.tab{ |
|
|
|
.tab { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
margin-bottom: 24px; |
|
|
|
margin-bottom: 24px; |
|
|
|
border-bottom: 2px solid #E1E6F2; |
|
|
|
border-bottom: 2px solid #e1e6f2; |
|
|
|
li{ |
|
|
|
li { |
|
|
|
padding: 18px 0; |
|
|
|
padding: 18px 0; |
|
|
|
margin-bottom: -1px; |
|
|
|
margin-bottom: -1px; |
|
|
|
font-size: 16px; |
|
|
|
font-size: 16px; |
|
|
|
color: #555; |
|
|
|
color: #555; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
border-bottom: 4px solid transparent; |
|
|
|
border-bottom: 4px solid transparent; |
|
|
|
&:last-child{ |
|
|
|
&:last-child { |
|
|
|
margin-right: 0; |
|
|
|
margin-right: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
&.active{ |
|
|
|
&.active { |
|
|
|
color: $main-color;; |
|
|
|
color: $main-color; |
|
|
|
border-bottom-color: $main-color; |
|
|
|
border-bottom-color: $main-color; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -519,29 +583,29 @@ export default { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
.form{ |
|
|
|
.form { |
|
|
|
width: 436px; |
|
|
|
width: 436px; |
|
|
|
padding: 38px 38px 60px; |
|
|
|
padding: 38px 38px 60px; |
|
|
|
margin: 0 auto 0; |
|
|
|
margin: 0 auto 0; |
|
|
|
border-radius: 6px; |
|
|
|
border-radius: 6px; |
|
|
|
background-color: #fff; |
|
|
|
background-color: #fff; |
|
|
|
.title{ |
|
|
|
.title { |
|
|
|
margin-bottom: 25px; |
|
|
|
margin-bottom: 25px; |
|
|
|
font-size: 26px; |
|
|
|
font-size: 26px; |
|
|
|
color: #0B1D30; |
|
|
|
color: #0b1d30; |
|
|
|
letter-spacing: 4px; |
|
|
|
letter-spacing: 4px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/.el-form-item{ |
|
|
|
/deep/.el-form-item { |
|
|
|
margin-bottom: 20px; |
|
|
|
margin-bottom: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/.el-input__inner{ |
|
|
|
/deep/.el-input__inner { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
height: 52px; |
|
|
|
height: 52px; |
|
|
|
padding: 0 20px 0 34px; |
|
|
|
padding: 0 20px 0 34px; |
|
|
|
line-height: 50px; |
|
|
|
line-height: 50px; |
|
|
|
background-color: #FBFBFB; |
|
|
|
background-color: #fbfbfb; |
|
|
|
border: 1px solid #E1E6F2; |
|
|
|
border: 1px solid #e1e6f2; |
|
|
|
border-radius: 4px !important; |
|
|
|
border-radius: 4px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
.default-check { |
|
|
|
.default-check { |
|
|
@ -559,33 +623,33 @@ export default { |
|
|
|
height: 18px; |
|
|
|
height: 18px; |
|
|
|
background: url(../../../assets/img/login/account.png) 0 0/100% 100% no-repeat; |
|
|
|
background: url(../../../assets/img/login/account.png) 0 0/100% 100% no-repeat; |
|
|
|
} |
|
|
|
} |
|
|
|
.school{ |
|
|
|
.school { |
|
|
|
background-image: url(../../../assets/img/login/school.png); |
|
|
|
background-image: url(../../../assets/img/login/school.png); |
|
|
|
} |
|
|
|
} |
|
|
|
.workNumber{ |
|
|
|
.workNumber { |
|
|
|
width: 17px; |
|
|
|
width: 17px; |
|
|
|
background-image: url(../../../assets/img/login/workNumber.png); |
|
|
|
background-image: url(../../../assets/img/login/workNumber.png); |
|
|
|
} |
|
|
|
} |
|
|
|
.password{ |
|
|
|
.password { |
|
|
|
top: 18px; |
|
|
|
top: 18px; |
|
|
|
background-image: url(../../../assets/img/login/password.png); |
|
|
|
background-image: url(../../../assets/img/login/password.png); |
|
|
|
} |
|
|
|
} |
|
|
|
.code{ |
|
|
|
.code { |
|
|
|
top: 18px; |
|
|
|
top: 18px; |
|
|
|
background-image: url(../../../assets/img/login/code.png); |
|
|
|
background-image: url(../../../assets/img/login/code.png); |
|
|
|
} |
|
|
|
} |
|
|
|
.ver-img{ |
|
|
|
.ver-img { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 1px; |
|
|
|
top: 1px; |
|
|
|
right: 1px; |
|
|
|
right: 1px; |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/.el-form-item__error{ |
|
|
|
/deep/.el-form-item__error { |
|
|
|
top: 105%; |
|
|
|
top: 105%; |
|
|
|
left: auto; |
|
|
|
left: auto; |
|
|
|
right: 0; |
|
|
|
right: 0; |
|
|
|
color: #FFA94E; |
|
|
|
color: #ffa94e; |
|
|
|
} |
|
|
|
} |
|
|
|
.submit{ |
|
|
|
.submit { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 48px; |
|
|
|
height: 48px; |
|
|
|
margin-top: 30px; |
|
|
|
margin-top: 30px; |
|
|
@ -597,16 +661,16 @@ export default { |
|
|
|
border: 0; |
|
|
|
border: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.copyright{ |
|
|
|
.copyright { |
|
|
|
padding: 18px 0; |
|
|
|
padding: 18px 0; |
|
|
|
font-size: 12px; |
|
|
|
font-size: 12px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
background-color: #F3F6FA; |
|
|
|
background-color: #f3f6fa; |
|
|
|
a{ |
|
|
|
a { |
|
|
|
color:#B1B4B8; |
|
|
|
color: #b1b4b8; |
|
|
|
font-size: 12px; |
|
|
|
font-size: 12px; |
|
|
|
&:hover{ |
|
|
|
&:hover { |
|
|
|
opacity: .8; |
|
|
|
opacity: 0.8; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|