|
|
|
@ -78,7 +78,7 @@ |
|
|
|
|
<el-form-item label="验证码"> |
|
|
|
|
<div class="flex"> |
|
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode(1)" :disabled="phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
@ -90,8 +90,8 @@ |
|
|
|
|
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia" width="500px"> |
|
|
|
|
<p class="tips">该手机号已绑定以下用户信息</p> |
|
|
|
|
<ul class="users"> |
|
|
|
|
<li v-for="(user, i) in users" :key="i" @click="chooseUser(user)"> |
|
|
|
|
<span>{{ user.schoolName }},{{ user.userName }},{{ user.workNumber }}</span> |
|
|
|
|
<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> |
|
|
|
|
<i class="el-icon-right"></i> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
@ -163,7 +163,7 @@ export default { |
|
|
|
|
userVisible: false, |
|
|
|
|
users: [], |
|
|
|
|
accountIds: [], |
|
|
|
|
binding: true |
|
|
|
|
binding: '' |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: {vHead,vFooter}, |
|
|
|
@ -178,16 +178,27 @@ export default { |
|
|
|
|
...mapActions('user', [ |
|
|
|
|
'login', 'setCustomer' |
|
|
|
|
]), |
|
|
|
|
// 赋值学校列表及id |
|
|
|
|
setSchool(list) { |
|
|
|
|
this.schoolList = list |
|
|
|
|
// 取本地缓存里的学校id |
|
|
|
|
const schoolId = util.local.get(schoolIdKey) |
|
|
|
|
if (schoolId) this.form.schoolId = schoolId |
|
|
|
|
}, |
|
|
|
|
// 获取学校列表 |
|
|
|
|
getSchool() { |
|
|
|
|
this.$get(this.api.querySchool, { |
|
|
|
|
provinceId: '', |
|
|
|
|
cityId: '' |
|
|
|
|
}).then(res => { |
|
|
|
|
this.schoolList = res.list |
|
|
|
|
// 取本地缓存里的学校id |
|
|
|
|
const schoolId = util.local.get(schoolIdKey) |
|
|
|
|
if (schoolId) this.form.schoolId = schoolId |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
const schoolList = util.local.get('schoolList') |
|
|
|
|
if (schoolList && schoolList.length) { |
|
|
|
|
this.setSchool(schoolList) |
|
|
|
|
} else { |
|
|
|
|
this.$get(this.api.querySchool, { |
|
|
|
|
provinceId: '', |
|
|
|
|
cityId: '' |
|
|
|
|
}).then(({ list }) => { |
|
|
|
|
this.setSchool(list) |
|
|
|
|
util.local.set('schoolList', list) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 切换标签 |
|
|
|
|
typeClick(tab) { |
|
|
|
@ -217,7 +228,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 选择用户回调 |
|
|
|
|
chooseUser(user) { |
|
|
|
|
this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => { |
|
|
|
|
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => { |
|
|
|
|
this.queryClient(data.token) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
@ -325,7 +336,7 @@ export default { |
|
|
|
|
sendPhoneCodeLogin() { |
|
|
|
|
const phone = this.form.account |
|
|
|
|
if (!this.verifyPhone(phone)) return false |
|
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0`).then(({ message }) => { |
|
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${Setting.platformId}`).then(({ message }) => { |
|
|
|
|
util.successMsg(message) |
|
|
|
|
this.phoneCountdownLogin() |
|
|
|
|
}).catch(res => {}) |
|
|
|
@ -345,14 +356,14 @@ export default { |
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
cancelButtonText: '否' |
|
|
|
|
}).then(() => { |
|
|
|
|
debugger |
|
|
|
|
this.binding = true |
|
|
|
|
this.sendPhoneCode(1) |
|
|
|
|
}).catch(() => { |
|
|
|
|
debugger |
|
|
|
|
this.binding = false |
|
|
|
|
this.sendPhoneCode(0) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.binding = true |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
@ -394,7 +405,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} else { |
|
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=1`).then(({ message }) => { |
|
|
|
|
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=1&platform=${Setting.platformId}`).then(({ message }) => { |
|
|
|
|
util.successMsg(message) |
|
|
|
|
this.phoneCountdown() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} |
|
|
|
@ -411,8 +423,8 @@ export default { |
|
|
|
|
schoolId, |
|
|
|
|
type, |
|
|
|
|
workNumber, |
|
|
|
|
}).then(({ token }) => { |
|
|
|
|
this.token = token |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.token = data.token |
|
|
|
|
this.setLogin() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
@ -595,6 +607,11 @@ export default { |
|
|
|
|
font-size: 14px; |
|
|
|
|
background-color: #ebeef5; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&.isEnable { |
|
|
|
|
color: #c0c4cc; |
|
|
|
|
background-color: #f5f7fa; |
|
|
|
|
cursor: not-allowed; |
|
|
|
|
} |
|
|
|
|
&:last-child { |
|
|
|
|
margin-bottom: 0; |
|
|
|
|
} |
|
|
|
|