The problem leads: When placing an order for a product, the user did not select an address and used a global exception to be thrown back to the front-end prompt. The global exception error message can be obtained locally, but it cannot be obtained when deployed to the test environment.
Reason: Because of carelessness, the error message returned by the global exception is e.getMessage but the error message I got is taken
Wrong way
/**
* 接口 业务异常
*/
@ResponseBody
@ExceptionHandler(ApiMallPlusException.class)
public Object ApiMallPlusException(ApiMallPlusException e){
//错误的取法 e.getMessage() 应该取e.getErrmsg()
log.error(e.getMessage(), e);
R result = R.failed(500, e.getMessage());return result;}