|
|
@ -15,7 +15,7 @@ |
|
|
|
<el-option v-for="(item, i) in schoolList" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option> |
|
|
|
<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 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> |
|
|
@ -32,9 +32,9 @@ |
|
|
|
</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="flex"> |
|
|
|
<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" placeholder="请输入验证码" maxlength="6" @keyup.enter.native="submit"></el-input> |
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }} |
|
|
|
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }} |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -71,14 +71,14 @@ |
|
|
|
|
|
|
|
|
|
|
|
<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 ref="form" label-width="60px"> |
|
|
|
<el-form label-width="60px"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-input style="width: 394px;" 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="flex"> |
|
|
|
<div class="ver-code"> |
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
<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> |
|
|
@ -96,6 +96,24 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" custom-class="info-dia" width="400px"> |
|
|
|
|
|
|
|
<div class="info-header"> |
|
|
|
|
|
|
|
<i class="el-icon-warning"></i> |
|
|
|
|
|
|
|
提示 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="info-wrap"> |
|
|
|
|
|
|
|
<p class="tips">该手机号已与以下用户绑定</p> |
|
|
|
|
|
|
|
<ul class="users"> |
|
|
|
|
|
|
|
<li v-for="(user, i) in infos" :key="i"> |
|
|
|
|
|
|
|
<span>{{ user.userName }}({{ user.schoolName }})</span> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
<div class="info-footer"> |
|
|
|
|
|
|
|
<el-button size="small" type="primary" @click="bindPhone">是本人,继续绑定</el-button> |
|
|
|
|
|
|
|
<el-button class="unbind" size="small" @click="unbindPhone">不是本人,解绑以上用户并绑定新用户</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<div class="footer"> |
|
|
|
<div class="footer"> |
|
|
|
<div class="copyright"> |
|
|
|
<div class="copyright"> |
|
|
@ -163,7 +181,9 @@ export default { |
|
|
|
userVisible: false, |
|
|
|
userVisible: false, |
|
|
|
users: [], |
|
|
|
users: [], |
|
|
|
accountIds: [], |
|
|
|
accountIds: [], |
|
|
|
binding: '' |
|
|
|
binding: '', |
|
|
|
|
|
|
|
infoVisible: false, |
|
|
|
|
|
|
|
infos: [] |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: {vHead,vFooter}, |
|
|
|
components: {vHead,vFooter}, |
|
|
@ -332,27 +352,30 @@ export default { |
|
|
|
this.phoneCountdownLogin() |
|
|
|
this.phoneCountdownLogin() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 继续绑定 |
|
|
|
|
|
|
|
bindPhone() { |
|
|
|
|
|
|
|
this.infoVisible = false |
|
|
|
|
|
|
|
this.binding = true |
|
|
|
|
|
|
|
this.sendPhoneCode(1) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 解除绑定 |
|
|
|
|
|
|
|
unbindPhone() { |
|
|
|
|
|
|
|
this.infoVisible = false |
|
|
|
|
|
|
|
this.binding = false |
|
|
|
|
|
|
|
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) { |
|
|
|
const msg = [] |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
|
msg.push(`${e.userName}(${e.schoolName},学号${e.workNumber})`) |
|
|
|
const { userName } = e |
|
|
|
|
|
|
|
if (userName.length > 1) e.userName = userName[0] + '*' + userName.substring(2) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.infos = list |
|
|
|
this.accountIds = list.map(e => e.id) |
|
|
|
this.accountIds = list.map(e => e.id) |
|
|
|
this.$confirm(`该手机号已与${msg.join(';')}的用户绑定,是否为本人?选择否,则解绑以上用户信息,并授权手机号绑定新用户信息。`, '提示', { |
|
|
|
this.infoVisible = true |
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
|
|
|
cancelButtonText: '否' |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
this.binding = true |
|
|
|
|
|
|
|
this.sendPhoneCode(1) |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
this.binding = false |
|
|
|
|
|
|
|
this.sendPhoneCode(0) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.binding = true |
|
|
|
this.binding = true |
|
|
|
} |
|
|
|
} |
|
|
@ -424,6 +447,7 @@ export default { |
|
|
|
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('请输入验证码') |
|
|
|
|
|
|
|
const { workNumber, schoolId } = this.form |
|
|
|
if (this.binding) { |
|
|
|
if (this.binding) { |
|
|
|
this.$post(this.api.bindPhoneOrEmail, { |
|
|
|
this.$post(this.api.bindPhoneOrEmail, { |
|
|
|
phone, |
|
|
|
phone, |
|
|
@ -431,7 +455,8 @@ export default { |
|
|
|
code: phoneCode, |
|
|
|
code: phoneCode, |
|
|
|
opener: this.phoneOpener, |
|
|
|
opener: this.phoneOpener, |
|
|
|
platform: Setting.platformId, |
|
|
|
platform: Setting.platformId, |
|
|
|
account: this.form.workNumber |
|
|
|
account: workNumber, |
|
|
|
|
|
|
|
schoolId |
|
|
|
}).then(({ token }) => { |
|
|
|
}).then(({ token }) => { |
|
|
|
this.token = token |
|
|
|
this.token = token |
|
|
|
this.setLogin() |
|
|
|
this.setLogin() |
|
|
@ -449,6 +474,14 @@ export default { |
|
|
|
min-height: 100%; |
|
|
|
min-height: 100%; |
|
|
|
background-color: #F3F6FA; |
|
|
|
background-color: #F3F6FA; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.ver-code { |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
.el-button { |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 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); |
|
|
|