|
|
|
@ -23,7 +23,7 @@ |
|
|
|
|
<el-option label="老师工号" :value="0"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="workNumber"> |
|
|
|
|
<el-form-item class="flex-1" prop="workNumber"> |
|
|
|
|
<label class="label account"></label> |
|
|
|
|
<el-input v-model.trim="form.workNumber" :placeholder="'请输入' + (form.type ? '学生学号' : '老师工号')" @keyup.enter.native="submit"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
@ -41,9 +41,9 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="code"> |
|
|
|
|
<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-button style="margin-left: 10px" type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }} |
|
|
|
|
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }} |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
@ -81,14 +81,14 @@ |
|
|
|
|
<div style='padding: 0 13px 20px 13px;'> |
|
|
|
|
依据国家政策法规,需绑定手机号进行实网络实名才可登录使用本平台 |
|
|
|
|
</div> |
|
|
|
|
<el-form ref="form" label-width="60px"> |
|
|
|
|
<el-form label-width="60px"> |
|
|
|
|
<el-form-item label="手机号"> |
|
|
|
|
<el-input style="width: 100%;" placeholder="请输入手机号" v-model="phone" maxlength="11" @change="phoneChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="验证码"> |
|
|
|
|
<div style="display: flex;"> |
|
|
|
|
<div class="ver-code"> |
|
|
|
|
<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 style="top: 1px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{ phoneBtnText }} |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
@ -119,6 +119,24 @@ |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" custom-class="info-dia" :show-close="false" 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> |
|
|
|
|
<v-footer ref="footer"></v-footer> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -182,7 +200,9 @@ export default { |
|
|
|
|
userVisible: false, |
|
|
|
|
users: [], |
|
|
|
|
accountIds: [], |
|
|
|
|
binding: '' |
|
|
|
|
binding: '', |
|
|
|
|
infoVisible: false, |
|
|
|
|
infos: [] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: { |
|
|
|
@ -299,7 +319,8 @@ export default { |
|
|
|
|
util.successMsg('登录成功') |
|
|
|
|
this.$router.replace('/station') |
|
|
|
|
}, |
|
|
|
|
submit() { // 提交登录 |
|
|
|
|
// 提交登录 |
|
|
|
|
submit() { |
|
|
|
|
this.$refs.form.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
@ -389,27 +410,30 @@ export default { |
|
|
|
|
this.phoneCountdownLogin() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 继续绑定 |
|
|
|
|
bindPhone() { |
|
|
|
|
this.infoVisible = false |
|
|
|
|
this.binding = true |
|
|
|
|
this.sendPhoneCode(1) |
|
|
|
|
}, |
|
|
|
|
// 解除绑定 |
|
|
|
|
unbindPhone() { |
|
|
|
|
this.infoVisible = false |
|
|
|
|
this.binding = false |
|
|
|
|
this.sendPhoneCode(0) |
|
|
|
|
}, |
|
|
|
|
// 手机号失去焦点回调 |
|
|
|
|
phoneChange() { |
|
|
|
|
this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => { |
|
|
|
|
const list = userAccounts |
|
|
|
|
if (list) { |
|
|
|
|
const msg = [] |
|
|
|
|
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.$confirm(`该手机号已与${msg.join(';')}的用户绑定,是否为本人?选择否,则解绑以上用户信息,并授权手机号绑定新用户信息。`, '提示', { |
|
|
|
|
type: 'warning', |
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
cancelButtonText: '否' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.binding = true |
|
|
|
|
this.sendPhoneCode(1) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.binding = false |
|
|
|
|
this.sendPhoneCode(0) |
|
|
|
|
}) |
|
|
|
|
this.infoVisible = true |
|
|
|
|
} else { |
|
|
|
|
this.binding = true |
|
|
|
|
} |
|
|
|
@ -480,6 +504,7 @@ export default { |
|
|
|
|
const { phone, phoneCode } = this |
|
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
|
if (!phoneCode) return util.warningMsg('请输入验证码') |
|
|
|
|
const { workNumber, schoolId } = this.form |
|
|
|
|
if (this.binding) { |
|
|
|
|
this.$post(this.api.bindPhoneOrEmail, { |
|
|
|
|
phone, |
|
|
|
@ -487,7 +512,8 @@ export default { |
|
|
|
|
code: phoneCode, |
|
|
|
|
opener: this.phoneOpener, |
|
|
|
|
platform: Setting.platformId, |
|
|
|
|
account: this.form.workNumber |
|
|
|
|
account: workNumber, |
|
|
|
|
schoolId |
|
|
|
|
}).then(({ token }) => { |
|
|
|
|
this.token = token |
|
|
|
|
this.setLogin() |
|
|
|
@ -505,6 +531,14 @@ export default { |
|
|
|
|
min-height: 100%; |
|
|
|
|
background-color: #F3F6FA; |
|
|
|
|
} |
|
|
|
|
.ver-code { |
|
|
|
|
position: relative; |
|
|
|
|
.el-button { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 10px; |
|
|
|
|
right: 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.login{ |
|
|
|
|
min-height: calc(100vh - 43px); |
|
|
|
|
padding-top: calc((100vh - 584px) / 2); |
|
|
|
@ -698,6 +732,49 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.info-dia { |
|
|
|
|
.el-dialog__header { |
|
|
|
|
border-bottom: 0; |
|
|
|
|
} |
|
|
|
|
.info-header { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 20px; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
.el-icon-warning { |
|
|
|
|
margin-right: 10px; |
|
|
|
|
color: #e6a23c; |
|
|
|
|
font-size: 24px; |
|
|
|
|
} |
|
|
|
|
.info-wrap { |
|
|
|
|
padding: 10px 33px; |
|
|
|
|
} |
|
|
|
|
.users { |
|
|
|
|
max-height: 125px; |
|
|
|
|
margin-top: 20px; |
|
|
|
|
overflow: auto; |
|
|
|
|
li { |
|
|
|
|
margin: 5px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.info-footer { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
margin-top: 20px; |
|
|
|
|
} |
|
|
|
|
.el-button { |
|
|
|
|
width: 142px; |
|
|
|
|
} |
|
|
|
|
.unbind { |
|
|
|
|
white-space: normal; |
|
|
|
|
line-height: 1.6; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@media (max-height: 680px) { |
|
|
|
|
.wrap .login { |
|
|
|
|
padding: 40px 0; |
|
|
|
|