-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,222 additions
and
2,238 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
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## v1.4.3 | ||
|
||
### chore | ||
|
||
- chore(frontend): 迁移到 biome(#65) | ||
|
||
## v1.4.2 | ||
|
||
### fixed | ||
|
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,15 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.7.2/schema.json", | ||
"files": { | ||
"ignore": ["miniprogram/miniprogram_npm/**/*"] | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
} | ||
} |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import http from '@utils/http' | ||
import { URL } from '@constant/accessToken' | ||
import { CODE } from '@constant/error' | ||
import logger from '@utils/logger' | ||
import error from '@utils/error' | ||
import { HttpError } from '@models/error' | ||
import type { LoginRequest, LoginResponse } from 'types/accessToken' | ||
import { URL } from "@constant/accessToken"; | ||
import { CODE } from "@constant/error"; | ||
import { HttpError } from "@models/error"; | ||
import error from "@utils/error"; | ||
import http from "@utils/http"; | ||
import logger from "@utils/logger"; | ||
import type { LoginRequest, LoginResponse } from "types/accessToken"; | ||
|
||
const login = async (code: string) => { | ||
try { | ||
return await http.post<LoginResponse>(URL.LOGIN, { code } as LoginRequest) | ||
} catch (e: unknown) { | ||
logger.error('登录接口请求失败', e) | ||
try { | ||
return await http.post<LoginResponse>(URL.LOGIN, { code } as LoginRequest); | ||
} catch (e: unknown) { | ||
logger.error("登录接口请求失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_ACCESS_TOKEN_LOGIN, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError( | ||
CODE.HTTP_API_ACCESS_TOKEN_LOGIN, | ||
error.getErrorMessage(e), | ||
); | ||
} | ||
}; | ||
|
||
export default { login } | ||
export default { login }; |
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 |
---|---|---|
@@ -1,21 +1,24 @@ | ||
import http from '@utils/http' | ||
import { URL } from '@constant/shortUrl' | ||
import { CODE } from '@constant/error' | ||
import { HttpError } from '@models/error' | ||
import logger from '@utils/logger' | ||
import error from '@utils/error' | ||
import type { CreateRequest, CreateResponse } from 'types/shortUrl' | ||
import { CODE } from "@constant/error"; | ||
import { URL } from "@constant/shortUrl"; | ||
import { HttpError } from "@models/error"; | ||
import error from "@utils/error"; | ||
import http from "@utils/http"; | ||
import logger from "@utils/logger"; | ||
import type { CreateRequest, CreateResponse } from "types/shortUrl"; | ||
|
||
const create = async (url: string) => { | ||
try { | ||
return await http.post<CreateResponse>(URL.CREATE, { | ||
url | ||
} as CreateRequest) | ||
} catch (e: unknown) { | ||
logger.error('创建短链接失败', e) | ||
try { | ||
return await http.post<CreateResponse>(URL.CREATE, { | ||
url, | ||
} as CreateRequest); | ||
} catch (e: unknown) { | ||
logger.error("创建短链接失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_SHORT_URL_CREATE, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError( | ||
CODE.HTTP_API_SHORT_URL_CREATE, | ||
error.getErrorMessage(e), | ||
); | ||
} | ||
}; | ||
|
||
export default { create } | ||
export default { create }; |
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 |
---|---|---|
@@ -1,66 +1,66 @@ | ||
import http from '@utils/http' | ||
import { URL } from '@constant/totp' | ||
import { CODE } from '@constant/error' | ||
import { HttpError } from '@models/error' | ||
import logger from '@utils/logger' | ||
import error from '@utils/error' | ||
import { CODE } from "@constant/error"; | ||
import { URL } from "@constant/totp"; | ||
import { HttpError } from "@models/error"; | ||
import error from "@utils/error"; | ||
import http from "@utils/http"; | ||
import logger from "@utils/logger"; | ||
import type { | ||
CreateRequest, | ||
DeleteRequest, | ||
DetailRequest, | ||
Item, | ||
Response, | ||
UpdateRequest | ||
} from 'types/totp' | ||
CreateRequest, | ||
DeleteRequest, | ||
DetailRequest, | ||
Item, | ||
Response, | ||
UpdateRequest, | ||
} from "types/totp"; | ||
|
||
const all = async () => { | ||
try { | ||
return await http.post<Item[]>(URL.ALL) | ||
} catch (e: unknown) { | ||
logger.error('查询 TOTP 列表失败', e) | ||
try { | ||
return await http.post<Item[]>(URL.ALL); | ||
} catch (e: unknown) { | ||
logger.error("查询 TOTP 列表失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_TOTP_ALL, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_TOTP_ALL, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
const detail = async (id: number) => { | ||
try { | ||
return await http.post<Item>(URL.DETAIL, { id } as DetailRequest) | ||
} catch (e: unknown) { | ||
logger.error('查询 TOTP 详情失败', e) | ||
try { | ||
return await http.post<Item>(URL.DETAIL, { id } as DetailRequest); | ||
} catch (e: unknown) { | ||
logger.error("查询 TOTP 详情失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_TOTP_DETAIL, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_TOTP_DETAIL, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
const create = async (uri: string) => { | ||
try { | ||
return await http.post<Response>(URL.CREATE, { uri } as CreateRequest) | ||
} catch (e: unknown) { | ||
logger.error('创建 TOTP 失败', e) | ||
try { | ||
return await http.post<Response>(URL.CREATE, { uri } as CreateRequest); | ||
} catch (e: unknown) { | ||
logger.error("创建 TOTP 失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_TOTP_CREATE, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_TOTP_CREATE, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
const update = async (data: UpdateRequest) => { | ||
try { | ||
return await http.post<Response>(URL.UPDATE, data) | ||
} catch (e: unknown) { | ||
logger.error('更新 TOTP 信息失败', e) | ||
try { | ||
return await http.post<Response>(URL.UPDATE, data); | ||
} catch (e: unknown) { | ||
logger.error("更新 TOTP 信息失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_TOTP_UPDATE, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_TOTP_UPDATE, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
const deleteTotp = async (id: number) => { | ||
try { | ||
return await http.post<Response>(URL.DELETE, { id } as DeleteRequest) | ||
} catch (e: unknown) { | ||
logger.error('删除 TOTP 失败', e) | ||
try { | ||
return await http.post<Response>(URL.DELETE, { id } as DeleteRequest); | ||
} catch (e: unknown) { | ||
logger.error("删除 TOTP 失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_TOTP_ALL, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_TOTP_ALL, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
export default { all, detail, create, update, deleteTotp } | ||
export default { all, detail, create, update, deleteTotp }; |
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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import http from '@utils/http' | ||
import { URL } from '@constant/user' | ||
import { CODE } from '@constant/error' | ||
import logger from '@utils/logger' | ||
import error from '@utils/error' | ||
import { HttpError } from '@models/error' | ||
import type { DetailResponse, UpdateRequest, UpdateResponse } from 'types/user' | ||
import { CODE } from "@constant/error"; | ||
import { URL } from "@constant/user"; | ||
import { HttpError } from "@models/error"; | ||
import error from "@utils/error"; | ||
import http from "@utils/http"; | ||
import logger from "@utils/logger"; | ||
import type { DetailResponse, UpdateRequest, UpdateResponse } from "types/user"; | ||
|
||
const detail = async () => { | ||
try { | ||
return await http.post<DetailResponse>(URL.DETAIL) | ||
} catch (e: unknown) { | ||
logger.error('查询用户详情失败', e) | ||
try { | ||
return await http.post<DetailResponse>(URL.DETAIL); | ||
} catch (e: unknown) { | ||
logger.error("查询用户详情失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_USER_DETAIL, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_USER_DETAIL, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
const update = async (updated: UpdateRequest) => { | ||
try { | ||
return await http.post<UpdateResponse>(URL.UPDATE, updated) | ||
} catch (e: unknown) { | ||
logger.error('更新用户信息失败', e) | ||
try { | ||
return await http.post<UpdateResponse>(URL.UPDATE, updated); | ||
} catch (e: unknown) { | ||
logger.error("更新用户信息失败", e); | ||
|
||
throw new HttpError(CODE.HTTP_API_USER_UPDATE, error.getErrorMessage(e)) | ||
} | ||
} | ||
throw new HttpError(CODE.HTTP_API_USER_UPDATE, error.getErrorMessage(e)); | ||
} | ||
}; | ||
|
||
export default { detail, update } | ||
export default { detail, update }; |
Oops, something went wrong.