huanglizhi 1 gadu atpakaļ
vecāks
revīzija
43de2d0667

+ 6 - 4
module-erp/src/main/java/com/hys/app/controller/erp/use/PayController.java

@@ -29,6 +29,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
@@ -133,7 +134,7 @@ public class PayController {
     }
 
     @GetMapping("/weixin/callback/openidCode")
-    public String handleWeixinCallback(@RequestParam("code") String code, @RequestParam("state") String state, HttpSession session) throws UnsupportedEncodingException {
+    public void handleWeixinCallback(@RequestParam("code") String code, @RequestParam("state") String state, HttpSession session, HttpServletResponse response) throws Exception {
         System.out.println("授权回调来了啊    code=" + code + "111111111111111111111111111111111111111111111state=" + state);
         String[] split = state.split("--");
         String orderId = split[0];
@@ -156,9 +157,10 @@ public class PayController {
         } else {
             price = aDo.getRealPrice() * (1 + aDo.getTaxRate() * 0.01);
         }
-        System.out.println("redirect:" + ip + "#/payType?id=" + aDo.getId() + "&sn=" + aDo.getSn() + "&price=" + price + "&openid=" + openId + "8888888888888888888888888888888888888888888");
         String url = ip + "#/payType?id=" + aDo.getId() + "&sn=" + aDo.getSn() + "&price=" + price + "&openid=" + openId;
-        String encodedUrl = URLEncoder.encode(url, "UTF-8");
-        return "redirect:" + encodedUrl;
+        response.sendRedirect(url);
+
+
+
     }
 }