config.default.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 'use strict';
  2. const path = require('path');
  3. module.exports = appInfo => {
  4. const config = exports = {};
  5. // use for cookie sign key, should change to your own and keep security
  6. config.keys = appInfo.name + '_smartcost3850888';
  7. // 数据库配置
  8. config.mysql = {
  9. client: {
  10. // host
  11. host: '127.0.0.1',
  12. // 端口号
  13. port: '3306',
  14. // 用户名
  15. user: 'root',
  16. // 密码
  17. password: 'admin',
  18. // 数据库名
  19. database: 'index_sys',
  20. },
  21. // 是否加载到 app 上,默认开启
  22. app: true,
  23. // 是否加载到 agent 上,默认关闭
  24. agent: false,
  25. };
  26. // view
  27. config.view = {
  28. mapping: {
  29. '.ejs': 'ejs',
  30. },
  31. root: [
  32. path.join(appInfo.baseDir, 'app/view'),
  33. ].join(','),
  34. };
  35. // session
  36. config.session = {
  37. key: 'ZHC_SESS',
  38. maxAge: 3600 * 1000,
  39. httpOnly: true,
  40. encrypt: true,
  41. };
  42. // 表名前缀
  43. config.tablePrefix = 'is_';
  44. // add your config here
  45. config.middleware = ['urlParse'];
  46. // 上传设置
  47. config.multipart = {
  48. whitelist: ['.xls', '.xlsx'],
  49. fileSize: '10mb',
  50. };
  51. return config;
  52. };