|
@@ -12,6 +12,8 @@ import com.google.zxing.EncodeHintType;
|
|
|
import com.google.zxing.client.j2se.MatrixToImageWriter;
|
|
|
import com.google.zxing.common.BitMatrix;
|
|
|
import com.google.zxing.qrcode.QRCodeWriter;
|
|
|
+import com.szwl.constant.ResponseCodesEnum;
|
|
|
+import com.szwl.exception.BizException;
|
|
|
import com.szwl.feign.bean.SzwlFeign;
|
|
|
import com.szwl.model.bo.JsonMessage;
|
|
|
import com.szwl.model.bo.R;
|
|
@@ -30,6 +32,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.servlet.view.RedirectView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -98,6 +101,21 @@ public class TOrderController {
|
|
|
// resp.sendRedirect(weixin);
|
|
|
return "请使用支付宝或微信扫码!";
|
|
|
}
|
|
|
+ @ApiOperation(value = "请求在线支付 主扫")
|
|
|
+ @RequestMapping("/aliPay2")
|
|
|
+ public RedirectView alipayforward2(String wx, String zfb, HttpServletRequest req, HttpServletResponse resp) throws Exception {
|
|
|
+ String userAgent = req.getHeader("User-Agent");
|
|
|
+ RedirectView redirectTarget = new RedirectView();
|
|
|
+ redirectTarget.setContextRelative(true);
|
|
|
+ if (userAgent.contains("MicroMessenger")){ // 微信
|
|
|
+ redirectTarget.setUrl(wx);
|
|
|
+ }else if(userAgent.contains("AlipayClient")){ // 支付宝
|
|
|
+ redirectTarget.setUrl(zfb);
|
|
|
+ }else{
|
|
|
+ throw new BizException(ResponseCodesEnum.A0001,"请使用支付宝或微信扫码!");
|
|
|
+ }
|
|
|
+ return redirectTarget;
|
|
|
+ }
|
|
|
/**
|
|
|
* 请求在线支付 主扫 优惠码 盲盒
|
|
|
*
|