登录及可视化修改

dev_2022-04-07
yujialong 3 years ago
parent 665c4c1630
commit f7bf73d9b1
  1. 6
      src/api/index.js
  2. 57
      src/pages/account/login/index.vue
  3. 8
      src/pages/screen/list/index.vue
  4. 2
      src/setting.js

@ -5,8 +5,10 @@ export default {
// 登录注册 // 登录注册
logins: `users/users/user/login`, logins: `users/users/user/login`,
verification:`${host}users/users/user/captcha`, verification:`${host}users/users/user/captcha`,
sendPhoneVerificationCode: `${host}users/users/user/sendPhoneVerificationCode`, sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`,
getToken: `users/users/user/getToken`, getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`,
// 加密货币 // 加密货币
market: `topic/market`, market: `topic/market`,
@ -48,7 +50,7 @@ export default {
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`, unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`, bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,
examinePassword: `users/users/userAccount/examinePassword`, examinePassword: `users/users/userAccount/examinePassword`,
isClient: `users/users/user/isClient`, isClient: `${host}users/users/user/isClient`,
deleteProfile: `users/users/userInfo/deleteProfile`, deleteProfile: `users/users/userInfo/deleteProfile`,
checkEmailOrPhone: `occupationlab/architecture/checkEmailOrPhone`, checkEmailOrPhone: `occupationlab/architecture/checkEmailOrPhone`,
accountIsDisabled: `users/users/user/accountIsDisabled`, accountIsDisabled: `users/users/user/accountIsDisabled`,

@ -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() {
this.$get(this.api.querySchool, { const schoolList = util.local.get('schoolList')
provinceId: '', if (schoolList && schoolList.length) {
cityId: '' this.setSchool(schoolList)
}).then(res => { } else {
this.schoolList = res.list this.$get(this.api.querySchool, {
// id provinceId: '',
const schoolId = util.local.get(schoolIdKey) cityId: ''
if (schoolId) this.form.schoolId = schoolId }).then(({ list }) => {
}).catch(res => {}) this.setSchool(list)
util.local.set('schoolList', list)
}).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;
} }

@ -400,8 +400,8 @@ export default {
}, },
grid: { grid: {
top: '40%', top: '40%',
left: '3%', left: '10',
right: '4%', right: '40',
bottom: '3%', bottom: '3%',
containLabel: true containLabel: true
}, },
@ -417,7 +417,8 @@ export default {
color: ['#6188e9','#9032f3','#a57de3','#4BF0FF','#44AFF0','#4E82FF','#584BFF','#BE4DFF','#F845F1'], color: ['#6188e9','#9032f3','#a57de3','#4BF0FF','#44AFF0','#4E82FF','#584BFF','#BE4DFF','#F845F1'],
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: ['20%', '20%'],
left: '20%',
data: data.map(e => e.date.replace(' 00:00:00', '')), // data: data.map(e => e.date.replace(' 00:00:00', '')), //
splitLine: { splitLine: {
show: false show: false
@ -431,6 +432,7 @@ export default {
yAxis: { yAxis: {
name: '', name: '',
type: 'value', type: 'value',
left: '20%',
splitLine: { splitLine: {
show: false show: false
}, },

@ -25,7 +25,7 @@ const Setting = {
* 正式http://www.dataforward.cn:9000 * 正式http://www.dataforward.cn:9000
* */ * */
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000', // apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://192.168.31.137:9000/' : `${location.origin}:9000/`, apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000/' : `${location.origin}:9000/`,
// 加密货币接口地址 // 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`, cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒

Loading…
Cancel
Save