This commit is contained in:
Your Name
2026-03-01 14:17:59 +08:00
parent 65aa12f146
commit a07e844c47
6071 changed files with 777651 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
import { defineStore } from 'pinia'
import { getConfig } from '@/api/app'
interface AppSate {
config: Record<string, any>
}
export const useAppStore = defineStore({
id: 'appStore',
state: (): AppSate => ({
config: {
domain: ''
}
}),
getters: {
getWebsiteConfig: (state) => state.config.website || {},
getLoginConfig: (state) => state.config.login || {},
getTabbarConfig: (state) => state.config.tabbar || [],
getStyleConfig: (state) => state.config.style || {},
getH5Config: (state) => state.config.webPage || {},
getCopyrightConfig: (state) => state.config.copyright || [],
},
actions: {
getImageUrl(url: string) {
return url.indexOf('http') ? `${this.config.domain}${url}` : url
},
async getConfig() {
const data = await getConfig()
this.config = data
}
}
})