|
|
@@ -6,6 +6,8 @@ import com.supplier.jwt.JWTUtil;
|
|
|
import com.supplier.model.Supplier;
|
|
|
import com.supplier.model.User;
|
|
|
import com.supplier.service.PersonalServce;
|
|
|
+import com.supplier.util.DesDecry;
|
|
|
+import com.supplier.util.DesEncry;
|
|
|
import com.supplier.util.ParsingToken;
|
|
|
import com.supplier.vx.WxLogin;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -46,18 +48,14 @@ public class WXLoginController {
|
|
|
@RequestMapping("/notify/code")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> notifyCode(String code, String type) {
|
|
|
- System.out.println(code);
|
|
|
//获取回调地址中的code
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
try{
|
|
|
Map<String, Object> wxMap = wxLogin(code, type); //微信回调数据
|
|
|
- System.out.println(wxMap);
|
|
|
- System.out.println(wxMap.get("msg"));
|
|
|
//调用成功
|
|
|
if(wxMap.get("msg") == "200"){
|
|
|
JSONObject jsonObject1 = (JSONObject) wxMap.get("data");
|
|
|
int sex = 1;
|
|
|
- System.out.println(jsonObject1);
|
|
|
if(null != jsonObject1.get("sex").toString()){
|
|
|
sex = Integer.parseInt(jsonObject1.get("sex").toString()) == 0 ? 1 : 2;
|
|
|
}
|
|
|
@@ -88,6 +86,7 @@ public class WXLoginController {
|
|
|
// 生成jwt的令牌
|
|
|
String token = JWTUtil.getToken(payload);
|
|
|
user.setToken(token);
|
|
|
+ user.setPhone(DesDecry.decrypt(user.getPhone()));
|
|
|
}
|
|
|
map.put("data", user);
|
|
|
map.put("msg", "200");
|