|
@@ -10,7 +10,8 @@ import com.miaxis.common.utils.StringUtils;
|
|
|
import com.miaxis.user.service.IUserInfoService;
|
|
|
import com.miaxis.user.vo.UserVipInfoVO;
|
|
|
import com.miaxis.wx.dto.WxGetPhoneDTO;
|
|
|
-import com.miaxis.wx.service.IWxLocalService;
|
|
|
+import com.miaxis.wx.dto.WxacodeUnlimitDTO;
|
|
|
+import com.miaxis.wx.service.IWxXcxService;
|
|
|
import com.miaxis.wx.service.IWxService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -40,7 +41,7 @@ public class UserInfoController extends BaseController {
|
|
|
private IUserInfoService userInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
- private IWxLocalService wxLocalService;
|
|
|
+ private IWxXcxService xcxService;
|
|
|
|
|
|
@Autowired
|
|
|
private IWxService wxService;
|
|
@@ -104,7 +105,7 @@ public class UserInfoController extends BaseController {
|
|
|
@GetMapping(value = "/getPhoneByCode")
|
|
|
@ApiOperation("根据code获取手机号")
|
|
|
public Response getPhoneByCode(String code) {
|
|
|
- String accsesToken = wxLocalService.getLocalXcxToken();
|
|
|
+ String accsesToken = xcxService.getLocalXcxToken();
|
|
|
WxGetPhoneDTO wxGetPhoneDTO = new WxGetPhoneDTO();
|
|
|
wxGetPhoneDTO.setCode(code);
|
|
|
String resultStr = wxService.getUserPhoneNumber(accsesToken, wxGetPhoneDTO);
|
|
@@ -121,6 +122,24 @@ public class UserInfoController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取个人小程序二维码
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/getWxacodeunLimit")
|
|
|
+ @ApiOperation("获取个人小程序二维码")
|
|
|
+ public Response getWxacodeunLimit() {
|
|
|
+ UserInfo userInfo = SecurityUtils.getLoginUser().getStudent();
|
|
|
+ String token = xcxService.getLocalXcxToken();
|
|
|
+ WxacodeUnlimitDTO unlimitDTO = new WxacodeUnlimitDTO();
|
|
|
+ unlimitDTO.setScene(userInfo.getUnionId());
|
|
|
+ unlimitDTO.setEnv_version("trial");
|
|
|
+ byte[] data = wxService.getWxacodeunLimit(token,unlimitDTO);
|
|
|
+ String base64Str = Base64.getEncoder().encodeToString(data);
|
|
|
+ System.out.println(base64Str);
|
|
|
+ return Response.success(base64Str);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
private String getSign(Integer isVip, String unionId) throws Exception {
|
|
|
String str = unionId + isVip;
|