提交 c3144125 编写于 作者: chenzhehao's avatar chenzhehao

微信昵称字符处理

上级 127f88df
......@@ -17,8 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
/**
......@@ -52,7 +50,7 @@ public class CoreServiceImpl implements CoreService {
if (CommonUtils.checkSignature(signature, timestamp, nonce)) {
return echostr;
}
logger.error("微信验证接口异常" );
logger.error("微信验证接口异常");
return null;
}
......@@ -123,11 +121,7 @@ public class CoreServiceImpl implements CoreService {
wechatUser.setOpenid((String) map.get("openid"));
wechatUser.setType(1);//1、云鹊医联
wechatUser.setSex((Integer) map.get("sex"));
try {
wechatUser.setNickname(URLEncoder.encode((String) map.get("nickname"),"utf-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
wechatUser.setNickname((String) map.get("nickname"));
wechatUser.setProvince((String) map.get("province"));
wechatUser.setCity((String) map.get("city"));
wechatUser.setCountry((String) map.get("country"));
......
......@@ -42,4 +42,6 @@ management.security.enabled=false
spring.zipkin.base-url=http://192.168.110.133:7895
spring.sleuth.sampler.percentage=1.0
logging.config=classpath:log4j2-test1.xml
\ No newline at end of file
logging.config=classpath:log4j2-test1.xml
spring.datasource.connection-init-sqls=set names utf8mb4
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册