| | |
| | | import cc.mrbird.febs.common.utils.SpringContextUtil;
|
| | | import cc.mrbird.febs.mall.entity.MallMember;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import cn.hutool.crypto.SecureUtil;
|
| | | import cn.hutool.crypto.asymmetric.KeyType;
|
| | | import cn.hutool.crypto.asymmetric.RSA;
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.fasterxml.jackson.databind.ObjectMapper;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | |
| | | private void responseUnAuth(HttpServletResponse response) throws IOException {
|
| | | response.setCharacterEncoding("UTF-8");
|
| | | response.setContentType("application/json; charset=utf-8");
|
| | | response.getWriter().write(new ObjectMapper().writeValueAsString(new FebsResponse().code(HttpStatus.UNAUTHORIZED)));
|
| | |
|
| | | FebsResponse code = new FebsResponse().code(HttpStatus.UNAUTHORIZED);
|
| | | String encryptBase64 = SecureUtil.rsa(AppContants.RESP_PRIVATE_KEY, AppContants.RESP_PUBLIC_KEY).encryptBase64(JSONObject.toJSONString(code).getBytes(), KeyType.PublicKey);
|
| | | response.getWriter().write(new ObjectMapper().writeValueAsString(encryptBase64));
|
| | | // response.getWriter().write(new ObjectMapper().writeValueAsString(new FebsResponse().code(HttpStatus.UNAUTHORIZED)));
|
| | | }
|
| | |
|
| | | private String resolveToken(String token) {
|