This commit is contained in:
xion 2025-04-05 14:45:50 +08:00
parent 862b29cfa4
commit 53cd97454d
2 changed files with 1384 additions and 2 deletions

1379
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,9 @@ export type UploadConfig = {
type PostOpts = { type PostOpts = {
token?: string; token?: string;
}; };
export const defaultConfigKeys = ['upload.json', 'workspace.json', 'ai.json', 'user.json', 'vip.json'] as const;
type DefaultConfigKey = (typeof defaultConfigKeys)[number];
export class QueryConfig { export class QueryConfig {
query: Query; query: Query;
constructor(opts?: QueryConfigOpts) { constructor(opts?: QueryConfigOpts) {
@ -95,7 +98,7 @@ export class QueryConfig {
* @param key * @param key
* @returns * @returns
*/ */
async getConfigByKey(key: string, opts?: PostOpts) { async getConfigByKey(key: DefaultConfigKey, opts?: PostOpts) {
return this.post<Result<Config>>({ return this.post<Result<Config>>({
key: 'defaultConfig', key: 'defaultConfig',
configKey: key, configKey: key,
@ -124,7 +127,7 @@ export class VipQueryConfig extends QueryConfig {
key: 'shareConfig', key: 'shareConfig',
data: { data: {
type: 'vip', type: 'vip',
username: 'admin', username: 'root',
}, },
}); });
} }