-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 重构部分API请求部分,统合API至统一目录 (#240)
* 尝试对api进行整理,并对story相关api进行初步替换 * 对censor相关api进行修改 * refactor api: 为了方便调试,对请求的指向性方法修改为代理转发,并由.env控制 * refactor api: 对config路径下请求进行整合,并对相关依赖进行修改 * refactor api:对story相关api删除无用依赖 * refactor api: 对censor相关api删除无用依赖 * refactor api: 对im_connections路径下的请求进行整理并替换对应的依赖 * style(api):优化im_connection函数显示 * refactor(api):整合utils路径下的请求,并整理对应依赖项 * refactor(api):解耦im_connection路径下相关依赖,同时修改部分api函数参数 * refactor(api):整合dice路径下的请求,并整理对应依赖 * refactor(api):整合backup路径下请求,并整理相关依赖 * refactor(api):整合banconfig下的请求,并整理相关依赖 * refactor(api):整合group路径下的请求,并修改相关依赖 * refactor(api):整合牌堆管理相关请求,并整理相关依赖 * refactor(api):整合js路径下的请求,并整理相关依赖 * refactor(api):整合登陆相关请求,并修改相关依赖 * refactor(api):整合helpdoc路径请求,并整理相关依赖 * refactor(api):整合resource路径下请求,并整合相关依赖 --------- Co-authored-by: chary <[email protected]>
- Loading branch information
Showing
48 changed files
with
1,746 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_APP_APIURL="http://localhost:6394" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { createRequest } from ".."; | ||
|
||
const baseUrl = '/backup/' | ||
const request = createRequest(baseUrl) | ||
|
||
export function getBackupList() { | ||
return request<{items:BackupInfo[]}>('get', 'list') | ||
} | ||
|
||
export function getBackupConfig() { | ||
return request<BackupConfig>('get', 'config_get') | ||
} | ||
|
||
export function setBackupConfig(data: BackupConfig) { | ||
return request('post', 'config_set', data) | ||
} | ||
|
||
export function postDoBackup(selection: number) { | ||
return request('post', 'do_backup', { selection }) | ||
} | ||
|
||
export function postBackupDel(name: string) { | ||
return request<{ success: boolean }>('post', 'delete?name=' + name, { name }) | ||
} | ||
|
||
export function postBackupBatchDel(names: string[]) { | ||
return request<{ result: true } | { | ||
result: false, | ||
fails: string[], | ||
}>('post', 'batch_delete', { names }) | ||
} | ||
|
||
type BackupConfig = { | ||
autoBackupEnable: boolean, | ||
autoBackupTime: string, | ||
autoBackupSelection: number, | ||
backupCleanStrategy: number, | ||
backupCleanKeepCount: number, | ||
backupCleanKeepDur: string, | ||
backupCleanTrigger: number, | ||
backupCleanCron: string, | ||
autoBackupSelectionList: string[] | ||
} | ||
type BackupInfo = { | ||
name: string, | ||
fileSize: number, | ||
selection: number | ||
} |
Oops, something went wrong.