Skip to content

Commit

Permalink
Merge pull request niefy#82 from niefy/dev
Browse files Browse the repository at this point in the history
未配置公众号时提示优化
  • Loading branch information
niefy authored Apr 28, 2023
2 parents 09eebe3 + f0e04ea commit 600e4cc
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.web.bind.MissingRequestCookieException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;
Expand Down Expand Up @@ -48,6 +49,12 @@ public R handleAuthorizationException(AuthorizationException e) {
return R.error("没有权限,请联系管理员授权");
}

@ExceptionHandler(MissingRequestCookieException.class)
public R handleMissingRequestCookieException(MissingRequestCookieException e) {
logger.error(e.getMessage(), e);
return R.error("请先添加公众号");
}

@ExceptionHandler({WxErrorException.class})
public R handleWxErrorException(WxErrorException e) {
logger.error(e.getMessage(), e);
Expand Down

0 comments on commit 600e4cc

Please sign in to comment.