init:first commit of plus-ui
This commit is contained in:
35
src/utils/auth.ts
Normal file
35
src/utils/auth.ts
Normal file
@ -0,0 +1,35 @@
|
||||
import { getLocal } from '.';
|
||||
|
||||
const TokenKey = 'Admin-Token';
|
||||
|
||||
const tokenStorage = useStorage<null | string>(TokenKey, null);
|
||||
|
||||
export const getToken = () => tokenStorage.value;
|
||||
|
||||
export const setToken = (access_token: string) => (tokenStorage.value = access_token);
|
||||
|
||||
export const removeToken = () => (tokenStorage.value = null);
|
||||
|
||||
export const getDockSocketUrl = () => {
|
||||
return getLocal('dockSocketUrl');
|
||||
};
|
||||
|
||||
export const getHost = () => {
|
||||
return getLocal('host');
|
||||
};
|
||||
|
||||
export const getRtmpPort = () => {
|
||||
return getLocal('rtmpPort');
|
||||
};
|
||||
|
||||
export const getRtcPort = () => {
|
||||
return getLocal('rtcPort');
|
||||
};
|
||||
|
||||
export const getDockAir = () => {
|
||||
return getLocal('dockAir');
|
||||
};
|
||||
|
||||
export const getAiUrl = () => {
|
||||
return getLocal('aiUrl');
|
||||
};
|
Reference in New Issue
Block a user