mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-13 11:30:29 +08:00
feat: add auth mode and refactor frontend (#21)
This commit is contained in:
30
frontend/src/store/index.js
Normal file
30
frontend/src/store/index.js
Normal 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
|
||||
}
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user