|
@@ -49,6 +49,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import sun.misc.BASE64Decoder;
|
|
import sun.misc.BASE64Decoder;
|
|
|
|
+import sun.misc.BASE64Encoder;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @auther duota
|
|
* @auther duota
|
|
@@ -194,7 +195,8 @@ public class UserController extends BaseApiController {
|
|
}
|
|
}
|
|
phoneInfo = jsonObject.getJSONObject("phone_info");
|
|
phoneInfo = jsonObject.getJSONObject("phone_info");
|
|
} else {
|
|
} else {
|
|
- String res = weixinDecrypt(wxLoginParams.getEncryptedData(), appSecret, wxLoginParams.getIv());
|
|
|
|
|
|
+ BASE64Encoder encoder = new BASE64Encoder();
|
|
|
|
+ String res = weixinDecrypt(wxLoginParams.getEncryptedData(), encoder.encode(appSecret.getBytes()), wxLoginParams.getIv());
|
|
if (StringUtils.isBlank(res)) {
|
|
if (StringUtils.isBlank(res)) {
|
|
return error("手机号获取失败");
|
|
return error("手机号获取失败");
|
|
}
|
|
}
|
|
@@ -397,7 +399,7 @@ public class UserController extends BaseApiController {
|
|
try {
|
|
try {
|
|
BASE64Decoder decoder = new BASE64Decoder();
|
|
BASE64Decoder decoder = new BASE64Decoder();
|
|
// 根据微信文档要求需要把 密文、密钥、iv 使用BASE64进行解码
|
|
// 根据微信文档要求需要把 密文、密钥、iv 使用BASE64进行解码
|
|
- byte[] keyByte = new BASE64Decoder().decodeBuffer(skey);
|
|
|
|
|
|
+ byte[] keyByte = decoder.decodeBuffer(skey);
|
|
byte[] contentByte = decoder.decodeBuffer(content);
|
|
byte[] contentByte = decoder.decodeBuffer(content);
|
|
byte[] ivByte = decoder.decodeBuffer(ivParameter);
|
|
byte[] ivByte = decoder.decodeBuffer(ivParameter);
|
|
// 生成密码
|
|
// 生成密码
|