feat: add auth mode and refactor frontend (#21)

This commit is contained in:
Dream Hunter
2023-09-09 16:00:10 +08:00
committed by GitHub
parent 9d18f7b59b
commit a395b951e8
10 changed files with 311 additions and 239 deletions

View File

@@ -0,0 +1,30 @@
import { ref } from "vue";
import { createGlobalState, useStorage } from '@vueuse/core'
export const useGlobalState = createGlobalState(
() => {
const loading = ref(false);
const openSettings = ref({
prefix: '',
auth: false,
domains: [{
label: 'test.com',
value: 'test.com'
}]
})
const showAuth = ref(false);
const auth = useStorage('auth', '');
const jwt = useStorage('jwt', '');
const localeCache = useStorage('locale', 'zhCN');
const themeSwitch = useStorage('themeSwitch', false);
return {
loading,
openSettings,
showAuth,
auth,
jwt,
localeCache,
themeSwitch
}
},
)