From 0c8fb7a6b450873af850d6ba041c0943116d1457 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 20 Jul 2021 15:35:15 +0800 Subject: [PATCH] fix --- src/api/index.js | 4 +- src/layouts/header/index.vue | 10 +++- src/pages/account/login/index.vue | 4 +- src/pages/data/list/index.vue | 5 ++ src/pages/setting/person/download.vue | 8 ++- src/pages/setting/person/index.vue | 2 +- src/pages/setting/person/info.vue | 83 ++++++++++++--------------- src/pages/stat/list/index.vue | 12 +++- src/pages/user/list/index.vue | 29 ++++------ src/setting.js | 2 +- src/store/modules/user.js | 4 +- 11 files changed, 85 insertions(+), 78 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 70ff281..d7ab5da 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,6 @@ import Setting from '@/setting' let uploadURL = Setting.upload.apiURL -let host = 'http://www.liuwanr.cn' +let host = 'http://39.108.250.202:9000'// let host1 = 'http://192.168.31.125:9000'//林 let host2 = 'http://192.168.31.140:9000'//7 let host3 = 'http://192.168.31.137:9000'//陈 @@ -21,7 +21,7 @@ export default { queryCourseProfessional: `/nakadai/nakadai/professional/queryProfessional`, // 个人中心 - uploadUserAvatars: `/users/users/userAccount/updateUserAvatars`, + uploadUserAvatars: `${Setting.apiBaseURL}/users/users/userAccount/updateUserAvatars`, userInfo:`/users/users/userInfo/getUserInfo`, updateUser:`/users/users/userInfo/updateUser`, findPasswordByEmail:`/users/users/userAccount/findPasswordByEmail`, diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 33a6497..0489d89 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -41,9 +41,10 @@ export default { return { token: util.local.get(Setting.tokenKey), isLogin: this.$route.path == '/login', + customer: this.$route.query.customer, userName: '', isUser: false, - showSetting: true + showSetting: true, }; }, components: { navbar }, @@ -56,11 +57,15 @@ export default { ]) }, mounted(){ + if(this.customer){ + let customer = Boolean(atob(decodeURI(this.customer))) + this.setCustomer(customer) + } this.token && this.getUserInfo() }, methods: { ...mapActions('user', [ - 'setInfo','logout','setManager' + 'setInfo','logout','setManager','setCustomer' ]), getUserInfo(){ this.$get(this.api.userInfo).then(res => { @@ -107,6 +112,7 @@ export default { query: { mg: btoa(true), schoolId: btoa(this.schoolId), + customer: btoa(this.isCustomer) } }) window.open(route.href) diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index dd988a2..39f77ab 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -93,7 +93,7 @@ export default { }, methods: { ...mapActions('user', [ - 'login','setToken' + 'login','setCustomer' ]), typeClick(item){ this.form.account = '' @@ -181,7 +181,7 @@ export default { this.form.phone = this.phone this.phoneVisible = false - this.setToken(res.token) + this.setCustomer(res.customer) util.local.set(Setting.tokenKey,res.token,43200000) util.successMsg('登录成功') setTimeout(() => { diff --git a/src/pages/data/list/index.vue b/src/pages/data/list/index.vue index 9802e45..fc3fa54 100644 --- a/src/pages/data/list/index.vue +++ b/src/pages/data/list/index.vue @@ -134,9 +134,11 @@ import { mapState } from 'vuex' import axios from 'axios' import util from '@/libs/util' +import Setting from '@/setting' export default { data() { return { + token: util.local.get(Setting.tokenKey), typeId: this.$route.query.typeId, typeList: [], defaultType: '', @@ -350,6 +352,9 @@ export default { let endTime = this.endTime ? this.endTime : '' let frequency = this.frequency axios.get(`${this.api.downloadData}?tableName=${this.curRow.name}&table_id=${this.curRow.id}&fields=${newFields.join()}&startTime=${startTime}&endTime=${endTime}&frequency=${frequency}`,{ + headers: { + token: this.token + }, responseType: 'blob' }).then((res) => { msgObj.close() diff --git a/src/pages/setting/person/download.vue b/src/pages/setting/person/download.vue index 27538a5..e73f435 100644 --- a/src/pages/setting/person/download.vue +++ b/src/pages/setting/person/download.vue @@ -32,12 +32,13 @@