update
This commit is contained in:
parent
58308c741f
commit
4e291d6329
@ -9,10 +9,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
public class ApplicationConfig implements WebMvcConfigurer {
|
||||
|
||||
// 跨域 目前小程序不需要,暂时不用考虑
|
||||
// @Override
|
||||
// public void addCorsMappings(CorsRegistry registry) {
|
||||
// registry.addMapping("/**").allowedOrigins("*");
|
||||
// }
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**").allowedOrigins("*");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.xiaoyan.point.api.config;
|
||||
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import me.xiaoyan.point.api.error.BizException;
|
||||
import me.xiaoyan.point.api.pojo.dto.ApiResult;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -34,6 +35,9 @@ public class ResponseExceptionConfig {
|
||||
@ResponseBody
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public ApiResult exceptionHandler(HttpServletRequest req, Exception e) {
|
||||
if(e instanceof NotLoginException){
|
||||
return ApiResult.error(403,"登录凭证无效");
|
||||
}
|
||||
e.printStackTrace();
|
||||
return ApiResult.error(-1, "App Internal Error:" + e.getMessage());
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
drop database points_sys;
|
||||
create database points_sys;
|
||||
use points_sys;
|
||||
create table userinfo
|
||||
@ -43,8 +44,6 @@ create table sign_record
|
||||
ip varchar(50) not null,
|
||||
create_time datetime default current_timestamp
|
||||
) engine = innodb collate = 'utf8mb4_general_ci' comment '打卡记录表';
|
||||
create_time datetime default current_timestamp
|
||||
) engine = innodb comment '打卡记录表';
|
||||
|
||||
create table goods
|
||||
(
|
||||
|
Loading…
x
Reference in New Issue
Block a user