diff --git a/src/router/index.js b/src/router/index.js index 30b78bf..6fa5031 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -45,7 +45,7 @@ const mainRoutes = { // { path: '/customer_report_show', component: _import('modules/report/customer_report_show'), name: 'report', meta: { title: '自定义报表展示' } },//2022-04-20 自定义报表路径 ], beforeEnter (to, from, next) { - let token =Vue.cookie.get('token') + let token =Vue.cookie.get('token_plm') if (!token || !/\S/.test(token)) { clearLoginInfo() next({ name: 'login' }) diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index 8490880..0ae8526 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -19,7 +19,7 @@ const http = axios.create({ * 请求拦截 */ http.interceptors.request.use(config => { - config.headers['token'] =Vue.cookie.get('token') // 请求头带上token + config.headers['token'] =Vue.cookie.get('token_plm') // 请求头带上token return config }, error => { return Promise.reject(error) @@ -92,7 +92,7 @@ const instance = axios.create({ * 请求拦截 */ instance.interceptors.request.use(config => { - config.headers['token'] = Vue.cookie.get('token') // 请求头带上token + config.headers['token'] = Vue.cookie.get('token_plm') // 请求头带上token // 如果是 FormData,删除 Content-Type 让浏览器自动设置(包含 boundary) if (config.data instanceof FormData) { @@ -132,7 +132,7 @@ const instance2 = axios.create({ * 请求拦截 */ instance2.interceptors.request.use(config => { - config.headers['token'] = Vue.cookie.get('token') // 请求头带上token + config.headers['token'] = Vue.cookie.get('token_plm') // 请求头带上token // 如果是 FormData,删除 Content-Type 让浏览器自动设置(包含 boundary) if (config.data instanceof FormData) { diff --git a/src/utils/index.js b/src/utils/index.js index b153017..31dd0d6 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -59,7 +59,7 @@ export function treeDataTranslate (data, id = 'id', pid = 'parentId') { * 清除登录信息 */ export function clearLoginInfo () { - Vue.cookie.delete('token') + Vue.cookie.delete('token_plm') store.commit('resetStore') // 加入清空权限信息 sessionStorage.removeItem("dynamicMenuRoutes") diff --git a/src/views/common/login-token.vue b/src/views/common/login-token.vue index 7dc8bb0..b02d359 100644 --- a/src/views/common/login-token.vue +++ b/src/views/common/login-token.vue @@ -103,7 +103,7 @@ }) }).then(({data}) => { if (data && data.code === 0) { - this.$cookie.set('token', data.token) + this.$cookie.set('token_plm', data.token) this.$router.replace({ name: this.urlParam.path, params: { diff --git a/src/views/common/login.vue b/src/views/common/login.vue index fad05ee..ffc5174 100644 --- a/src/views/common/login.vue +++ b/src/views/common/login.vue @@ -117,7 +117,7 @@ }) }).then(({data}) => { if (data && data.code === 0) { - this.$cookie.set('token', data.token) + this.$cookie.set('token_plm', data.token) this.$router.replace({ name: 'home' }) this.$i18n.locale=data.language localStorage.setItem('locale', data.language) diff --git a/src/views/modules/common/excelUpload.vue b/src/views/modules/common/excelUpload.vue index 4a0436c..29ec1bd 100644 --- a/src/views/modules/common/excelUpload.vue +++ b/src/views/modules/common/excelUpload.vue @@ -26,7 +26,7 @@ }, methods: { init (id) { - this.url = this.$http.adornUrl(`/file/excel/upload?token=${this.$cookie.get('token')}`) + this.url = this.$http.adornUrl(`/file/excel/upload?token=${this.$cookie.get('token_plm')}`) this.visible = true }, // 上传之前 diff --git a/src/views/modules/common/file-list-view.vue b/src/views/modules/common/file-list-view.vue index 58e9d8b..2946fdc 100644 --- a/src/views/modules/common/file-list-view.vue +++ b/src/views/modules/common/file-list-view.vue @@ -134,7 +134,7 @@ export default { responseType: 'blob', headers: { 'Content-Type': 'application/json', - 'token': Vue.cookie.get('token') + 'token': Vue.cookie.get('token_plm') } }).then(({data}) => { // 不限制文件下载类型 diff --git a/src/views/modules/common/file-list.vue b/src/views/modules/common/file-list.vue index 3597f9f..75b86ed 100644 --- a/src/views/modules/common/file-list.vue +++ b/src/views/modules/common/file-list.vue @@ -150,7 +150,7 @@ export default { responseType: 'blob', headers: { 'Content-Type': 'application/json', - 'token': Vue.cookie.get('token') + 'token': Vue.cookie.get('token_plm') } }).then(({data}) => { // 不限制文件下载类型 diff --git a/src/views/modules/common/file-upload.vue b/src/views/modules/common/file-upload.vue index d913d43..3ab4ffe 100644 --- a/src/views/modules/common/file-upload.vue +++ b/src/views/modules/common/file-upload.vue @@ -43,7 +43,7 @@ export default { }, methods: { init(val) { - this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}&folder=` + this.folder) + this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token_plm')}&folder=` + this.folder) this.visible = true this.fileMappingDto = val }, diff --git a/src/views/modules/common/upload.vue b/src/views/modules/common/upload.vue index 01350e5..9c71644 100644 --- a/src/views/modules/common/upload.vue +++ b/src/views/modules/common/upload.vue @@ -27,7 +27,7 @@ }, methods: { init(id) { - this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}&folder=` + this.folder) + this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token_plm')}&folder=` + this.folder) this.visible = true }, // 上传之前 diff --git a/src/views/modules/oss/oss-upload.vue b/src/views/modules/oss/oss-upload.vue index 0a9004c..fcb52f6 100644 --- a/src/views/modules/oss/oss-upload.vue +++ b/src/views/modules/oss/oss-upload.vue @@ -33,7 +33,7 @@ }, methods: { init (id) { - this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token')}&folder=`+this.folder) + this.url = this.$http.adornUrl(`/ftp/file/upload?token=${this.$cookie.get('token_plm')}&folder=`+this.folder) console.log(this.url) this.visible = true }, diff --git a/src/views/modules/oss/oss.vue b/src/views/modules/oss/oss.vue index 7782e3b..f123089 100644 --- a/src/views/modules/oss/oss.vue +++ b/src/views/modules/oss/oss.vue @@ -291,7 +291,7 @@ export default { responseType: 'blob', headers: { 'Content-Type': 'application/json', - 'token': Vue.cookie.get('token') + 'token': Vue.cookie.get('token_plm') } }).then(({data}) => { // 不限制文件下载类型