mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-28 07:25:53 +00:00
feat: api接口新增access_token校验
This commit is contained in:
@@ -64,6 +64,7 @@ export const CONFIG_KEYS = {
|
||||
NOTIFICATION_POSITION: 'notificationPosition',
|
||||
NOTIFICATION_FILTER_MODE: 'notificationFilterMode',
|
||||
NOTIFICATION_FILTER_LIST: 'notificationFilterList',
|
||||
HTTP_API_TOKEN: 'httpApiToken',
|
||||
MESSAGE_PUSH_ENABLED: 'messagePushEnabled',
|
||||
WINDOW_CLOSE_BEHAVIOR: 'windowCloseBehavior',
|
||||
QUOTE_LAYOUT: 'quoteLayout',
|
||||
@@ -117,6 +118,17 @@ export async function getDbPath(): Promise<string | null> {
|
||||
return value as string | null
|
||||
}
|
||||
|
||||
// 获取api access_token
|
||||
export async function getHttpApiToken(): Promise<string> {
|
||||
const value = await config.get(CONFIG_KEYS.HTTP_API_TOKEN)
|
||||
return (value as string) || ''
|
||||
}
|
||||
|
||||
// 设置access_token
|
||||
export async function setHttpApiToken(token: string): Promise<void> {
|
||||
await config.set(CONFIG_KEYS.HTTP_API_TOKEN, token)
|
||||
}
|
||||
|
||||
// 设置数据库路径
|
||||
export async function setDbPath(path: string): Promise<void> {
|
||||
await config.set(CONFIG_KEYS.DB_PATH, path)
|
||||
|
||||
Reference in New Issue
Block a user