config.default.ts 874 B

123456789101112131415161718192021222324252627282930313233
  1. import { MidwayConfig } from '@midwayjs/core';
  2. export default {
  3. // use for cookie sign key, should change to your own and keep security
  4. keys: '1734594361174_9059',
  5. koa: {
  6. port: 7001,
  7. },
  8. /**上传设置, columns:涉及文件的字段:${表名}.${字段名} 表名用model的class名,因为在connect中存的就是这个类 */
  9. busboy: {
  10. mode: 'file',
  11. realdir: 'upload',
  12. whitelist: null,
  13. },
  14. jwt: {
  15. secret: 'Ziyouyanfa!@#',
  16. expiresIn: 3600, // 3600
  17. },
  18. /**启用checkToken中间件 */
  19. useCheckTokenMiddleware: true,
  20. /**不检查token的路由列表 */
  21. passToken: [
  22. '/login/:type',
  23. '/dictType',
  24. '/files/*',
  25. '/config',
  26. '/files/:project/upload',
  27. '/files/:project/:catalog/upload',
  28. '/files/:project/:catalog/:item/upload',
  29. ],
  30. /**请求头中token的key名 */
  31. tokenKey: 'token',
  32. } as MidwayConfig;