更新
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user