mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-13 08:20:27 +00:00
fix:coerce
This commit is contained in:
@@ -6,11 +6,11 @@ import { themeType } from '../types/theme';
|
||||
import { z } from 'zod';
|
||||
// 定义配置的类型
|
||||
const WebUiConfigSchema = z.object({
|
||||
host: z.string().default('0.0.0.0'),
|
||||
port: z.number().default(6099),
|
||||
token: z.string().default('napcat'),
|
||||
loginRate: z.number().default(10),
|
||||
autoLoginAccount: z.string().default(''),
|
||||
host: z.coerce.string().default('0.0.0.0'),
|
||||
port: z.coerce.number().default(6099),
|
||||
token: z.coerce.string().default('napcat'),
|
||||
loginRate: z.coerce.number().default(10),
|
||||
autoLoginAccount: z.coerce.string().default(''),
|
||||
theme: themeType,
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
||||
|
||||
export const themeType = z.object(
|
||||
{
|
||||
dark: z.record(z.string(), z.string()),
|
||||
light: z.record(z.string(), z.string()),
|
||||
dark: z.record(z.coerce.string(), z.coerce.string()),
|
||||
light: z.record(z.coerce.string(), z.coerce.string()),
|
||||
}
|
||||
).default({
|
||||
dark: {
|
||||
|
||||
Reference in New Issue
Block a user