|
|
@ -78,7 +78,7 @@ |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<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="phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
@ -90,8 +90,8 @@ |
|
|
|
<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 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 }}</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> |
|
|
@ -163,7 +163,7 @@ export default { |
|
|
|
userVisible: false, |
|
|
|
userVisible: false, |
|
|
|
users: [], |
|
|
|
users: [], |
|
|
|
accountIds: [], |
|
|
|
accountIds: [], |
|
|
|
binding: true |
|
|
|
binding: '' |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: {vHead,vFooter}, |
|
|
|
components: {vHead,vFooter}, |
|
|
@ -178,16 +178,27 @@ export default { |
|
|
|
...mapActions('user', [ |
|
|
|
...mapActions('user', [ |
|
|
|
'login', 'setCustomer' |
|
|
|
'login', 'setCustomer' |
|
|
|
]), |
|
|
|
]), |
|
|
|
|
|
|
|
// 赋值学校列表及id |
|
|
|
|
|
|
|
setSchool(list) { |
|
|
|
|
|
|
|
this.schoolList = list |
|
|
|
|
|
|
|
// 取本地缓存里的学校id |
|
|
|
|
|
|
|
const schoolId = util.local.get(schoolIdKey) |
|
|
|
|
|
|
|
if (schoolId) this.form.schoolId = schoolId |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取学校列表 |
|
|
|
getSchool() { |
|
|
|
getSchool() { |
|
|
|
|
|
|
|
const schoolList = util.local.get('schoolList') |
|
|
|
|
|
|
|
if (schoolList && schoolList.length) { |
|
|
|
|
|
|
|
this.setSchool(schoolList) |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$get(this.api.querySchool, { |
|
|
|
this.$get(this.api.querySchool, { |
|
|
|
provinceId: '', |
|
|
|
provinceId: '', |
|
|
|
cityId: '' |
|
|
|
cityId: '' |
|
|
|
}).then(res => { |
|
|
|
}).then(({ list }) => { |
|
|
|
this.schoolList = res.list |
|
|
|
this.setSchool(list) |
|
|
|
// 取本地缓存里的学校id |
|
|
|
util.local.set('schoolList', list) |
|
|
|
const schoolId = util.local.get(schoolIdKey) |
|
|
|
|
|
|
|
if (schoolId) this.form.schoolId = schoolId |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 切换标签 |
|
|
|
// 切换标签 |
|
|
|
typeClick(tab) { |
|
|
|
typeClick(tab) { |
|
|
@ -217,7 +228,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 选择用户回调 |
|
|
|
// 选择用户回调 |
|
|
|
chooseUser(user) { |
|
|
|
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) |
|
|
|
this.queryClient(data.token) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -325,7 +336,7 @@ 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`).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 => {}) |
|
|
@ -345,14 +356,14 @@ export default { |
|
|
|
confirmButtonText: '是', |
|
|
|
confirmButtonText: '是', |
|
|
|
cancelButtonText: '否' |
|
|
|
cancelButtonText: '否' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
debugger |
|
|
|
|
|
|
|
this.binding = true |
|
|
|
this.binding = true |
|
|
|
this.sendPhoneCode(1) |
|
|
|
this.sendPhoneCode(1) |
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
debugger |
|
|
|
|
|
|
|
this.binding = false |
|
|
|
this.binding = false |
|
|
|
this.sendPhoneCode(0) |
|
|
|
this.sendPhoneCode(0) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.binding = true |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -394,7 +405,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
} else { |
|
|
|
} 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() |
|
|
|
this.phoneCountdown() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
} |
|
|
|
} |
|
|
@ -411,8 +423,8 @@ export default { |
|
|
|
schoolId, |
|
|
|
schoolId, |
|
|
|
type, |
|
|
|
type, |
|
|
|
workNumber, |
|
|
|
workNumber, |
|
|
|
}).then(({ token }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.token = token |
|
|
|
this.token = data.token |
|
|
|
this.setLogin() |
|
|
|
this.setLogin() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -595,6 +607,11 @@ export default { |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
background-color: #ebeef5; |
|
|
|
background-color: #ebeef5; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
&.isEnable { |
|
|
|
|
|
|
|
color: #c0c4cc; |
|
|
|
|
|
|
|
background-color: #f5f7fa; |
|
|
|
|
|
|
|
cursor: not-allowed; |
|
|
|
|
|
|
|
} |
|
|
|
&:last-child { |
|
|
|
&:last-child { |
|
|
|
margin-bottom: 0; |
|
|
|
margin-bottom: 0; |
|
|
|
} |
|
|
|
} |
|
|
|