| | |
| | | package com.ruoyi.chargingPile.filter; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.common.core.constant.TokenConstants; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | private void unauthorizedResponse(HttpServletResponse response, String msg) { |
| | | response.setStatus(HttpStatus.OK.value()); |
| | | response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); |
| | | response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE); |
| | | PrintWriter writer = null; |
| | | try { |
| | | writer = response.getWriter(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | writer.println(R.fail(msg)); |
| | | writer.println(JSON.toJSONString(R.fail(msg))); |
| | | writer.flush(); |
| | | writer.close(); |
| | | } |