haiwei-ui 1.0.94 → 1.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haiwei-ui",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "HaiWei前端组件库",
5
5
  "author": "Eric",
6
6
  "license": "ISC",
@@ -149,6 +149,7 @@
149
149
  <script>
150
150
  import dialog from '../../../../mixins/components/dialog'
151
151
  import { mapState } from 'vuex'
152
+ import token from '../../../../utils/token'
152
153
  export default {
153
154
  mixins: [dialog],
154
155
  data() {
@@ -201,8 +202,11 @@
201
202
  return baseURL + path
202
203
  },
203
204
  headers() {
205
+ // 从token模块获取token
206
+ const t = token.get()
207
+ const accessToken = t && t.accessToken ? t.accessToken : ''
204
208
  return {
205
- 'Authorization': `Bearer ${this.token}`
209
+ 'Authorization': `Bearer ${accessToken}`
206
210
  }
207
211
  },
208
212
  uploadData() {
@@ -347,10 +351,13 @@
347
351
  formData.append('skipEmptyRows', this.model.skipEmptyRows)
348
352
 
349
353
  // 使用axios直接发送请求,避免$api可能为undefined的问题
354
+ // 从token模块获取token
355
+ const t = token.get()
356
+ const accessToken = t && t.accessToken ? t.accessToken : ''
350
357
  const config = {
351
358
  headers: {
352
359
  'Content-Type': 'multipart/form-data',
353
- 'Authorization': `Bearer ${this.token}`
360
+ 'Authorization': `Bearer ${accessToken}`
354
361
  }
355
362
  }
356
363