From f7bf73d9b1d0bdedb845979b30fb729053f91e7f Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 27 Apr 2022 11:13:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8F=8A=E5=8F=AF=E8=A7=86?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 6 ++-- src/pages/account/login/index.vue | 57 ++++++++++++++++++++----------- src/pages/screen/list/index.vue | 8 +++-- src/setting.js | 2 +- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index b3729f1..680a628 100644 --- a/src/api/index.js +++ b/src/api/index.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`, diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index e190c27..7e51404 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -78,7 +78,7 @@
- {{phoneBtnText}} + {{phoneBtnText}}
@@ -90,8 +90,8 @@

该手机号已绑定以下用户信息

@@ -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; } diff --git a/src/pages/screen/list/index.vue b/src/pages/screen/list/index.vue index 5d58651..ff0add2 100644 --- a/src/pages/screen/list/index.vue +++ b/src/pages/screen/list/index.vue @@ -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 }, diff --git a/src/setting.js b/src/setting.js index f9665dd..faeaa23 100644 --- a/src/setting.js +++ b/src/setting.js @@ -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/`, // 接口请求返回错误时,弹窗的持续时间,单位:秒