chore: src/modules/user/config.ts

This commit is contained in:
2026-07-01 17:45:04 +08:00
parent f5f80455d9
commit b0e2a84c61
+34
View File
@@ -0,0 +1,34 @@
import { ModuleConfig } from '@cool-midway/core';
import { UserMiddleware } from './middleware/app';
/**
* 模块配置
*/
export default () => {
return {
// 模块名称
name: '用户模块',
// 模块描述
description: 'APP、小程序、公众号等用户',
// 中间件,只对本模块有效
middlewares: [],
// 中间件,全局有效
globalMiddlewares: [UserMiddleware],
// 模块加载顺序,默认为0,值越大越优先加载
order: 0,
// 短信
sms: {
// 验证码有效期,单位秒
timeout: 60 * 3,
},
// jwt
jwt: {
// token 过期时间,单位秒
expire: 60 * 60 * 24,
// 刷新token 过期时间,单位秒
refreshExpire: 60 * 60 * 24 * 30,
// jwt 秘钥
secret: 'd8ac7767-01ed-4405-b0e7-c812d8aa8734x',
},
} as ModuleConfig;
};