config.qa.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: '192.168.1.70',
  12. // 端口号
  13. port: '3306',
  14. // 用户名
  15. user: 'root',
  16. // 密码
  17. password: 'root',
  18. // 数据库名
  19. database: 'index_sys',
  20. },
  21. // 是否加载到 app 上,默认开启
  22. app: true,
  23. // 是否加载到 agent 上,默认关闭
  24. agent: false,
  25. };
  26. // 表名前缀
  27. config.tablePrefix = 'is_';
  28. // view
  29. config.view = {
  30. mapping: {
  31. '.ejs': 'ejs',
  32. },
  33. root: [
  34. path.join(appInfo.baseDir, 'app/view'),
  35. ].join(','),
  36. };
  37. // session
  38. config.session = {
  39. key: 'ZHC_SESS',
  40. maxAge: 3600 * 1000,
  41. httpOnly: true,
  42. encrypt: true,
  43. };
  44. // add your config here
  45. config.middleware = ['urlParse'];
  46. // 上传设置
  47. config.multipart = {
  48. whitelist: ['.xls', '.xlsx', '.json'],
  49. fileSize: '10mb',
  50. };
  51. return config;
  52. };