haiwei-ui 1.0.91 → 1.0.94
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
|
@@ -190,7 +190,15 @@
|
|
|
190
190
|
computed: {
|
|
191
191
|
...mapState('app/user', { token: 'token' }),
|
|
192
192
|
uploadUrl() {
|
|
193
|
-
|
|
193
|
+
// 从axios默认配置中获取baseURL,如果不存在则使用全局变量或默认值
|
|
194
|
+
let baseURL = this.$http?.axios?.defaults?.baseURL || window.__HAIWEI_API_BASE_URL__ || '/api'
|
|
195
|
+
// 确保baseURL以斜杠结尾,但不要有双斜杠
|
|
196
|
+
if (!baseURL.endsWith('/')) {
|
|
197
|
+
baseURL += '/'
|
|
198
|
+
}
|
|
199
|
+
// 移除路径开头的斜杠,避免双斜杠
|
|
200
|
+
const path = 'admin/excel/parseexcel'.replace(/^\//, '')
|
|
201
|
+
return baseURL + path
|
|
194
202
|
},
|
|
195
203
|
headers() {
|
|
196
204
|
return {
|
|
@@ -346,7 +354,15 @@
|
|
|
346
354
|
}
|
|
347
355
|
}
|
|
348
356
|
|
|
349
|
-
|
|
357
|
+
// 使用与uploadUrl相同的逻辑获取API基础URL
|
|
358
|
+
let baseURL = this.$http?.axios?.defaults?.baseURL || window.__HAIWEI_API_BASE_URL__ || '/api'
|
|
359
|
+
// 确保baseURL以斜杠结尾,但不要有双斜杠
|
|
360
|
+
if (!baseURL.endsWith('/')) {
|
|
361
|
+
baseURL += '/'
|
|
362
|
+
}
|
|
363
|
+
// 移除路径开头的斜杠,避免双斜杠
|
|
364
|
+
const path = 'admin/excel/parseexcel'.replace(/^\//, '')
|
|
365
|
+
this.$http.post(baseURL + path, formData, config)
|
|
350
366
|
.then(response => {
|
|
351
367
|
if (response.data.successful) {
|
|
352
368
|
this.fileInfo = response.data.data.basicInfo
|