登录及可视化修改

dev_2022-04-07
yujialong 3 years ago
parent 665c4c1630
commit f7bf73d9b1
  1. 6
      src/api/index.js
  2. 49
      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`,
verification:`${host}users/users/user/captcha`,
sendPhoneVerificationCode: `${host}users/users/user/sendPhoneVerificationCode`,
sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`,
getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`,
// 加密货币
market: `topic/market`,
@ -48,7 +50,7 @@ export default {
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,
examinePassword: `users/users/userAccount/examinePassword`,
isClient: `users/users/user/isClient`,
isClient: `${host}users/users/user/isClient`,
deleteProfile: `users/users/userInfo/deleteProfile`,
checkEmailOrPhone: `occupationlab/architecture/checkEmailOrPhone`,
accountIsDisabled: `users/users/user/accountIsDisabled`,

@ -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() {
const schoolList = util.local.get('schoolList')
if (schoolList && schoolList.length) {
this.setSchool(schoolList)
} else {
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
}).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;
}

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

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

Loading…
Cancel
Save