This commit is contained in:
Your Name
2026-03-20 13:56:40 +08:00
parent 7147c8e148
commit d765517b74
258 changed files with 2481 additions and 364 deletions
+4 -1
View File
@@ -21,7 +21,10 @@ const useAppStore = defineStore({
},
actions: {
getImageUrl(url: string) {
return url.indexOf('http') ? `${this.config.oss_domain}${url}` : url
if (!url || typeof url !== 'string') return ''
if (url.startsWith('http://') || url.startsWith('https://')) return url
const domain = this.config.oss_domain || (typeof window !== 'undefined' ? window.location.origin + '/' : '')
return domain ? `${domain.replace(/\/$/, '')}${url.startsWith('/') ? url : '/' + url}` : url
},
getConfig() {
return new Promise((resolve, reject) => {