1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-15 04:07:20 +08:00
This commit is contained in:
SevCrane
2024-06-05 23:20:28 +08:00
commit 5e482958f6
7329 changed files with 240086 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
import {defineStore} from 'pinia';
import {store} from '/@/store';
import type {LocaleType, ThemeVal} from '/#/config';
import type {repositoryMap} from '/@/settings/repositorySeeing';
export const useAppStore = defineStore({
id: 'app',
state: (): AlasConfig => ({
theme: 'light',
language: 'zh-CN',
repository: 'global',
webuiUrl: '',
alasPath: '',
}),
getters: {
getTheme(): string {
return this.theme;
},
getLanguage(): LocaleType {
return this.language;
},
getRepository(): keyof typeof repositoryMap {
return this.repository;
},
getWebuiUrl(): string {
return this.webuiUrl;
},
getAlasPath(): string {
return this.alasPath;
},
},
actions: {
setTheme(theme: ThemeVal) {
this.theme = theme;
},
setLanguage(language: LocaleType) {
this.language = language;
},
setRepository(repository: AlasConfig['repository']) {
this.repository = repository;
},
setWebuiUrl(webuiUrl: AlasConfig['webuiUrl']) {
this.webuiUrl = webuiUrl;
},
setAlasPath(alasPath: AlasConfig['alasPath']) {
this.alasPath = alasPath;
},
},
});
export function useAppStoreWithOut() {
return useAppStore(store);
}