haiwei-module-admin 1.1.2 → 1.1.3

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
@@ -2,7 +2,7 @@
2
2
  "id": 0,
3
3
  "name": "haiwei-module-admin",
4
4
  "code": "admin",
5
- "version": "1.1.2",
5
+ "version": "1.1.3",
6
6
  "description": "haiwei前端Admin模块组件",
7
7
  "author": "Eric",
8
8
  "license": "ISC",
@@ -98,7 +98,19 @@ export default {
98
98
  this.url__ = this.fullPath
99
99
  } else {
100
100
  // 拼接 OSS 路径
101
- this.url__ = this.normalizePath(this.baseUrl + '/oss/o', this.fullPath)
101
+ // 移除 fullPath 开头的斜杠(如果有)
102
+ const cleanPath = this.fullPath.startsWith('/') ? this.fullPath.slice(1) : this.fullPath
103
+
104
+ // OSS 图片使用特定的 baseUrl(去掉 /api 部分)
105
+ let ossBaseUrl = this.baseUrl
106
+ // 如果 baseUrl 以 /api/ 结尾,去掉 /api
107
+ if (ossBaseUrl.endsWith('/api/')) {
108
+ ossBaseUrl = ossBaseUrl.slice(0, -4) // 去掉 '/api'
109
+ } else if (ossBaseUrl.endsWith('/api')) {
110
+ ossBaseUrl = ossBaseUrl.slice(0, -4) // 去掉 '/api'
111
+ }
112
+
113
+ this.url__ = this.normalizePath(ossBaseUrl, 'oss/o/' + cleanPath)
102
114
  }
103
115
  }
104
116
  } else if (this.url) {