haiwei-ui 1.0.9 → 1.0.91

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.9",
3
+ "version": "1.0.91",
4
4
  "description": "HaiWei前端组件库",
5
5
  "author": "Eric",
6
6
  "license": "ISC",
@@ -190,7 +190,7 @@
190
190
  computed: {
191
191
  ...mapState('app/user', { token: 'token' }),
192
192
  uploadUrl() {
193
- return `${this.$api.baseURL}/api/admin/excel/parseexcel`
193
+ return '/api/admin/excel/parseexcel'
194
194
  },
195
195
  headers() {
196
196
  return {
@@ -338,17 +338,23 @@
338
338
  formData.append('maxPreviewRows', this.model.maxPreviewRows)
339
339
  formData.append('skipEmptyRows', this.model.skipEmptyRows)
340
340
 
341
- this.$api.post('/api/admin/excel/parseexcel', formData, {
342
- headers: { 'Content-Type': 'multipart/form-data' }
343
- })
341
+ // 使用axios直接发送请求,避免$api可能为undefined的问题
342
+ const config = {
343
+ headers: {
344
+ 'Content-Type': 'multipart/form-data',
345
+ 'Authorization': `Bearer ${this.token}`
346
+ }
347
+ }
348
+
349
+ this.$http.post('/api/admin/excel/parseexcel', formData, config)
344
350
  .then(response => {
345
- if (response.successful) {
346
- this.fileInfo = response.data.basicInfo
347
- this.parseResult = response.data
351
+ if (response.data.successful) {
352
+ this.fileInfo = response.data.data.basicInfo
353
+ this.parseResult = response.data.data
348
354
  this.initColumnMapping()
349
355
  this._success('文件解析成功')
350
356
  } else {
351
- this._error(response.msg || '文件解析失败')
357
+ this._error(response.data.msg || '文件解析失败')
352
358
  }
353
359
  })
354
360
  .catch(error => {