feat(admin): 新增模板管理功能并完善用户认证
- 新增模板管理模块,包含模板列表和详情页面 - 重构用户认证逻辑,支持用户ID存储和API调用 - 新增排行榜API接口和类型定义 - 更新环境配置,添加开发环境配置 - 优化表格操作钩子,增强类型安全性 - 新增文件上传工具类和验证工具函数 - 更新路由配置,支持模板详情页面导航 - 修复登录表单默认值问题
This commit is contained in:
15
apps/admin/src/typings/api/Competition.d.ts
vendored
15
apps/admin/src/typings/api/Competition.d.ts
vendored
@ -31,6 +31,21 @@ declare namespace Api {
|
||||
*/
|
||||
type EnableStatus = '1' | '2'
|
||||
|
||||
/** question ui type */
|
||||
type QuestionUiType = '1' | '2' | '3' | '4' /** 文本输入 | 单选 | 多选 | 下拉选择 */
|
||||
|
||||
/** question time type */
|
||||
type QuestionTimeType = 5 | 10 | 15 | 20 | 30 | 45 | 60 | 90 /** 5s | 10s | 15s | 20s | 30s | 45s | 60s | 90s */
|
||||
|
||||
/** question template id */
|
||||
type QuestionTemplateId =
|
||||
| 'TEMPLATE_DICTATION_HINT'
|
||||
| 'TEMPLATE_DICTATION_HOMOPHONE'
|
||||
| 'TEMPLATE_COMPONENT_ADD'
|
||||
| 'TEMPLATE_WORD_DICTATION'
|
||||
| 'TEMPLATE_IDIOM_TEXT_REQ'
|
||||
| 'TEMPLATE_IDIOM_IMAGE' /** 汉字听写-提示 | 汉字听写-同音 | 汉字加一加 | 词语听写 | 成语-文字要求 | 成语-看图 */
|
||||
|
||||
/** question score type */
|
||||
type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */
|
||||
|
||||
|
||||
1
apps/admin/src/typings/api/auth.d.ts
vendored
1
apps/admin/src/typings/api/auth.d.ts
vendored
@ -8,6 +8,7 @@ declare namespace Api {
|
||||
interface LoginToken {
|
||||
token: string
|
||||
refreshToken: string
|
||||
id: number
|
||||
}
|
||||
|
||||
interface UserInfo {
|
||||
|
||||
12
apps/admin/src/typings/api/common.d.ts
vendored
12
apps/admin/src/typings/api/common.d.ts
vendored
@ -7,21 +7,21 @@ declare namespace Api {
|
||||
namespace Common {
|
||||
/** common params of paginating */
|
||||
interface PaginatingCommonParams {
|
||||
/** current page number */
|
||||
current: number
|
||||
/** page size */
|
||||
size: number
|
||||
/** currentPage page number */
|
||||
currentPage: number
|
||||
/** page pageSize */
|
||||
pageSize: number
|
||||
/** total count */
|
||||
total: number
|
||||
}
|
||||
|
||||
/** common params of paginating query list data */
|
||||
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
|
||||
records: T[]
|
||||
list: T[]
|
||||
}
|
||||
|
||||
/** common search params of table */
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'currentPage' | 'pageSize'>
|
||||
|
||||
/**
|
||||
* enable status
|
||||
|
||||
66
apps/admin/src/typings/api/question.d.ts
vendored
Normal file
66
apps/admin/src/typings/api/question.d.ts
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Namespace Api
|
||||
*
|
||||
* All backend api type
|
||||
*/
|
||||
declare namespace Api {
|
||||
namespace Question {
|
||||
/** common params of paginating */
|
||||
interface PaginatingCommonParams {
|
||||
/** current page number */
|
||||
current: number
|
||||
/** page size */
|
||||
size: number
|
||||
/** total count */
|
||||
total: number
|
||||
}
|
||||
|
||||
/** common params of paginating query list data */
|
||||
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
|
||||
records: T[]
|
||||
}
|
||||
|
||||
/** add params */
|
||||
interface AddParams {
|
||||
/** question id */
|
||||
id: string
|
||||
/** question name */
|
||||
name: string
|
||||
/** question content */
|
||||
questionContent: string
|
||||
}
|
||||
|
||||
/** common search params of table */
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>
|
||||
|
||||
/**
|
||||
* enable status
|
||||
*
|
||||
* - "1": enabled
|
||||
* - "2": disabled
|
||||
*/
|
||||
type EnableStatus = '1' | '2'
|
||||
|
||||
/** question score type */
|
||||
type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */
|
||||
|
||||
/** competition round type */
|
||||
type CompetitionRoundType = '1' | '2' /** 题包环节 | 加时环节 */
|
||||
|
||||
/** common record */
|
||||
type CommonRecord<T = any> = {
|
||||
/** record id */
|
||||
id: number
|
||||
/** record creator */
|
||||
createBy: string
|
||||
/** record create time */
|
||||
createTime: string
|
||||
/** record updater */
|
||||
updateBy: string
|
||||
/** record update time */
|
||||
updateTime: string
|
||||
/** record status */
|
||||
status: EnableStatus | null
|
||||
} & T
|
||||
}
|
||||
}
|
||||
64
apps/admin/src/typings/api/rank.d.ts
vendored
Normal file
64
apps/admin/src/typings/api/rank.d.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* Namespace Api
|
||||
*
|
||||
* All backend api type
|
||||
*/
|
||||
declare namespace Api {
|
||||
namespace Rank {
|
||||
/** common params of paginating */
|
||||
interface PaginatingCommonParams {
|
||||
/** currentPage page number */
|
||||
currentPage: number
|
||||
/** page pageSize */
|
||||
pageSize: number
|
||||
/** total count */
|
||||
total?: number
|
||||
}
|
||||
|
||||
/** user search params */
|
||||
interface UserSearchParams extends PaginatingCommonParams {
|
||||
/** competition activity name */
|
||||
competitionActivityName?: string
|
||||
/** publish status */
|
||||
publishStatus?: EnableStatus
|
||||
}
|
||||
|
||||
/** common params of paginating query list data */
|
||||
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
|
||||
records: T[]
|
||||
}
|
||||
|
||||
/** common search params of table */
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'currentPage' | 'pageSize'>
|
||||
|
||||
/**
|
||||
* enable status
|
||||
*
|
||||
* - "1": enabled
|
||||
* - "2": disabled
|
||||
*/
|
||||
type EnableStatus = '1' | '2'
|
||||
|
||||
/** question score type */
|
||||
type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */
|
||||
|
||||
/** competition round type */
|
||||
type CompetitionRoundType = '1' | '2' /** 题包环节 | 加时环节 */
|
||||
|
||||
/** common record */
|
||||
type CommonRecord<T = any> = {
|
||||
/** record id */
|
||||
id: number
|
||||
/** record creator */
|
||||
createBy: string
|
||||
/** record create time */
|
||||
createTime: string
|
||||
/** record updater */
|
||||
updateBy: string
|
||||
/** record update time */
|
||||
updateTime: string
|
||||
/** record status */
|
||||
status: EnableStatus | null
|
||||
} & T
|
||||
}
|
||||
}
|
||||
72
apps/admin/src/typings/api/template.d.ts
vendored
Normal file
72
apps/admin/src/typings/api/template.d.ts
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Namespace Api
|
||||
*
|
||||
* All backend api type
|
||||
*/
|
||||
declare namespace Api {
|
||||
namespace Template {
|
||||
/** common params of paginating */
|
||||
interface PaginatingCommonParams {
|
||||
/** currentPage page number */
|
||||
currentPage: number
|
||||
/** page pageSize */
|
||||
pageSize: number
|
||||
/** total count */
|
||||
total?: number
|
||||
}
|
||||
|
||||
/** template search params */
|
||||
interface TemplateSearchParams extends PaginatingCommonParams {
|
||||
/** competition activity name */
|
||||
competitionActivityName?: string
|
||||
/** publish status */
|
||||
publishStatus?: EnableStatus
|
||||
/** template name */
|
||||
templateName?: string
|
||||
/** competition id */
|
||||
competitionId?: string
|
||||
/** size */
|
||||
size?: string
|
||||
/** status */
|
||||
status?: EnableStatus | null
|
||||
}
|
||||
|
||||
/** common params of paginating query list data */
|
||||
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
|
||||
records: T[]
|
||||
}
|
||||
|
||||
/** common search params of table */
|
||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'currentPage' | 'pageSize'>
|
||||
|
||||
/**
|
||||
* enable status
|
||||
*
|
||||
* - "1": enabled
|
||||
* - "2": disabled
|
||||
*/
|
||||
type EnableStatus = '1' | '2'
|
||||
|
||||
/** question score type */
|
||||
type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */
|
||||
|
||||
/** competition round type */
|
||||
type CompetitionRoundType = '1' | '2' /** 题包环节 | 加时环节 */
|
||||
|
||||
/** common record */
|
||||
type CommonRecord<T = any> = {
|
||||
/** record id */
|
||||
id: number
|
||||
/** record creator */
|
||||
createBy: string
|
||||
/** record create time */
|
||||
createTime: string
|
||||
/** record updater */
|
||||
updateBy: string
|
||||
/** record update time */
|
||||
updateTime: string
|
||||
/** record status */
|
||||
status: EnableStatus | null
|
||||
} & T
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user