Преглед изворни кода

指引单二维码太复杂了,做个后端的重定向

lighter пре 1 година
родитељ
комит
7ba835d407

+ 16 - 2
src/main/java/thyyxxk/wxservice_server/controller/WeChatRedirectController.java

@@ -26,7 +26,7 @@ public class WeChatRedirectController {
 
     @PassToken
     @GetMapping("/page")
-    public void redirectRequest(@RequestParam("code") String code, HttpServletResponse response){
+    public void redirectRequest(@RequestParam("code") String code, HttpServletResponse response) {
         try {
             response.sendRedirect("https://staticweb.hnthyy.cn/wxService/" + code);
         } catch (IOException e) {
@@ -38,11 +38,25 @@ public class WeChatRedirectController {
     @GetMapping("/page2")
     public void redirectRequest2(@RequestParam("to") String to,
                                  @RequestParam("code") String code,
-                                 HttpServletResponse response){
+                                 HttpServletResponse response) {
         try {
             response.sendRedirect("https://staticweb.hnthyy.cn/wxService/" + code + '/' + to);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
+
+    @PassToken
+    @GetMapping("/guideBillScan")
+    public void redirectGuideBillScan(@RequestParam("patNo") String patNo,
+                                      HttpServletResponse response) {
+        try {
+            response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?" +
+                    "appid=wxbde6b16acad84204&redirect_uri=http://staticweb.hnthyy.cn/wxserver/redirect/page2?" +
+                    "to=fromGuideBillQrScan_" + patNo + "&response_type=code&scope=snsapi_base&state=1#wechat_redirect");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
 }