|
@@ -6,8 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.miaxis.common.config.WxpayConfig;
|
|
|
import com.miaxis.common.constant.Constants;
|
|
|
import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
+import com.miaxis.common.core.domain.model.LoginUser;
|
|
|
import com.miaxis.common.exception.CustomException;
|
|
|
import com.miaxis.common.utils.AesUtil;
|
|
|
+import com.miaxis.common.utils.SecurityUtils;
|
|
|
+import com.miaxis.framework.web.service.TokenService;
|
|
|
import com.miaxis.user.service.IUserInfoService;
|
|
|
import com.miaxis.wx.domain.RefundRecord;
|
|
|
import com.miaxis.wx.domain.WxOrder;
|
|
@@ -35,7 +38,6 @@ import java.nio.charset.StandardCharsets;
|
|
|
import java.security.*;
|
|
|
import java.security.cert.X509Certificate;
|
|
|
import java.util.Date;
|
|
|
-import java.util.Random;
|
|
|
|
|
|
@RestController
|
|
|
@RequiredArgsConstructor
|
|
@@ -62,6 +64,9 @@ public class WxNotifyController {
|
|
|
@Autowired
|
|
|
private AutoUpdateCertificatesVerifier verifier;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TokenService tokenService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 微信支付回调接口
|
|
@@ -229,6 +234,13 @@ public class WxNotifyController {
|
|
|
}
|
|
|
|
|
|
userInfoService.updateById(userinfo);
|
|
|
+
|
|
|
+ //更新上下文中对象状态
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
+ loginUser.setStudent(userinfo);
|
|
|
+ //刷新缓存中的数据
|
|
|
+ tokenService.refreshToken(loginUser);
|
|
|
+
|
|
|
return outTradeNo;
|
|
|
|
|
|
}
|
|
@@ -239,16 +251,7 @@ public class WxNotifyController {
|
|
|
return aesUtil.decryptToString(wxpaySource.getAssociated_data().getBytes(), wxpaySource.getNonce().getBytes(), wxpaySource.getCiphertext());
|
|
|
}
|
|
|
|
|
|
- private String randomVipcode() {
|
|
|
- String result = "";
|
|
|
- Random random = new Random();
|
|
|
- for(int i =0 ;i <11 ;i ++){
|
|
|
- result+=random.nextInt(10);
|
|
|
- }
|
|
|
- return result;
|
|
|
-
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|