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
|
@@ -98,7 +98,19 @@ export default {
|
|
|
98
98
|
this.url__ = this.fullPath
|
|
99
99
|
} else {
|
|
100
100
|
// 拼接 OSS 路径
|
|
101
|
-
|
|
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) {
|