$ npm i egg-normal-response-x --save
// {app_root}/config/plugin.js
exports.normalResponse = {
enable: true,
package: 'egg-normal-response-x',
};
// {app_root}/config/config.default.js
exports.normalResponse = {
outSystemError:false,
systemErrorCode:500,
userErrorCode:600,
succeeCode:200,
ignore: ["/*","*/upload/*","/assets/*","/static/*"]
};
see config/config.default.js for more detail.
error throw new UserRequestError("u-token不能为空","xxx",data);
Please open an issue here.