fix: login secret (#6635)

* fix: login secret

* lock

* env template

* fix: ts

* fix: ts

* fix: ts
This commit is contained in:
Archer
2026-03-25 14:45:38 +08:00
committed by GitHub
parent e48a037f2d
commit bd966d479f
54 changed files with 2061 additions and 500 deletions
@@ -1,6 +1,8 @@
import { AdminInformPath } from './inform';
import { AdminLoginPath } from './login';
import type { OpenAPIPath } from '../../../type';
export const AdminUserPath: OpenAPIPath = {
...AdminInformPath
...AdminInformPath,
...AdminLoginPath
};
@@ -0,0 +1,15 @@
import { z } from 'zod';
// Admin login request body
export const AdminLoginBodySchema = z.object({
username: z.string().meta({ description: '用户名' }),
password: z.string().meta({ description: '密码' })
});
export type AdminLoginBodyType = z.infer<typeof AdminLoginBodySchema>;
// Admin login response
export const AdminLoginResponseSchema = z.object({
user: z.any().meta({ description: '用户信息' }),
token: z.string().meta({ description: '登录令牌' })
});
export type AdminLoginResponseType = z.infer<typeof AdminLoginResponseSchema>;
@@ -0,0 +1,30 @@
import type { OpenAPIPath } from '../../../../type';
import { AdminLoginBodySchema, AdminLoginResponseSchema } from './api';
import { TagsMap } from '../../../../tag';
export const AdminLoginPath: OpenAPIPath = {
'/admin/support/user/login': {
post: {
summary: '管理员登录',
description: '管理员使用用户名和密码登录',
tags: [TagsMap.userLogin],
requestBody: {
content: {
'application/json': {
schema: AdminLoginBodySchema
}
}
},
responses: {
200: {
description: '登录成功',
content: {
'application/json': {
schema: AdminLoginResponseSchema
}
}
}
}
}
}
};