一. 使用dotenv,process.env无法获取自定义的参数
const path = require('path')
const dotenv = require('dotenv')
dotenv.config({
path:path.resolve(__dirname,'../../.env') // 必须要引入存放参数的问价*
})
module.exports = process.env
二.查询数数据库报错:Table ‘genesisprophet.gp_Amuses’ doesn’t exist
原因:创建模型是定义为gp_Amuse大写开头,数据表为小写 开发可以映射到,部署到服务器区分大小写,无法匹配到
const Amuse = seq.define('gp_Amuse', {})
解决:表名更改为小写字母
const Amuse = seq.define('gp_amuse', {})
三.上传文件报413Request EntityToo Large错误解决办法
原因:产生这种原因是因为服务器限制了上传大小
解决:nginx 可在http server location 配置
client_max_body_size 20M