feat: init

This commit is contained in:
ygx
2026-03-05 23:45:39 +08:00
commit 8fab91c5c7
214 changed files with 33682 additions and 0 deletions

23
src/utils/setup-mock.ts Normal file
View File

@@ -0,0 +1,23 @@
import debug from './env'
export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => {
if (mock !== false && debug) setup()
}
export const successResponseWrap = (data: unknown) => {
return {
data,
status: 'ok',
msg: '请求成功',
code: 20000,
}
}
export const failResponseWrap = (data: unknown, msg: string, code = 50000) => {
return {
data,
status: 'fail',
msg,
code,
}
}