Przeglądaj źródła

hash路由配置

lighter 2 tygodni temu
rodzic
commit
162ad8a689

+ 24 - 37
src/main/java/thyyxxk/wxservice_server/controller/WeChatRedirectController.java

@@ -7,11 +7,9 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import thyyxxk.wxservice_server.config.auth.PassToken;
 import thyyxxk.wxservice_server.dao.selfmachine.LoginDao;
-import thyyxxk.wxservice_server.utils.DateUtil;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.List;
 
 /**
  * @author dj
@@ -46,37 +44,34 @@ public class WeChatRedirectController {
     }
 
     @PassToken
-    @GetMapping("/page2")
-    public void redirectRequest2(@RequestParam("to") String to,
-                                 @RequestParam("code") String code,
-                                 HttpServletResponse response) {
+    @GetMapping("/hashPage")
+    public void hashPage(@RequestParam("code") String code, HttpServletResponse response) {
         try {
-            response.sendRedirect("https://huaihai-tech.com/wxservice/" + code + '/' + to);
+            response.sendRedirect("https://huaihai-tech.com/wxservice/#/wxservice/" + code);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
-
+    
     @PassToken
-    @GetMapping("/guideBillScan")
-    public void redirectGuideBillScan(@RequestParam("patNo") String patNo,
-                                      HttpServletResponse response) {
+    @GetMapping("/page2")
+    public void redirectRequest2(@RequestParam("to") String to,
+                                 @RequestParam("code") String code,
+                                 HttpServletResponse response) {
         try {
-            response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?" +
-                    "appid=wx85bf3fd255d86750&redirect_uri=https://huaihai-tech.com/wxserver/redirect/page2?" +
-                    "to=mzFeeList_" + patNo + "&response_type=code&scope=snsapi_base&state=1#wechat_redirect");
+            response.sendRedirect("https://huaihai-tech.com/wxservice/" + code + '/' + to);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
 
     @PassToken
-    @GetMapping("/inpatientQrEntry")
-    public void inpatientQrEntry(HttpServletResponse response) {
+    @GetMapping("/hashPage2")
+    public void hashPage2c(@RequestParam("to") String to,
+                                 @RequestParam("code") String code,
+                                 HttpServletResponse response) {
         try {
-            response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?" +
-                    "appid=wx85bf3fd255d86750&redirect_uri=https://huaihai-tech.com/wxserver/redirect/page2?" +
-                    "to=inpatientQrEntry&response_type=code&scope=snsapi_base&state=1#wechat_redirect");
+            response.sendRedirect("https://huaihai-tech.com/wxservice/#/wxservice/" + code + '/' + to);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
@@ -90,7 +85,7 @@ public class WeChatRedirectController {
             dao.deleteOldLoginRecord(id);
             dao.insertSelfMachineLogin(id);
         }
-        // 推荐人预约挂号链接。2801为推荐人工号,根据真实情况自行修改。
+        // 推荐人预约挂号链接(history路由)。2801为推荐人工号,根据真实情况自行修改。
         // https://huaihai-tech.com/wxservice/pathEntry?path=appointment_recStaff-2801
         try {
             response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?" +
@@ -102,26 +97,18 @@ public class WeChatRedirectController {
     }
 
     @PassToken
-    @GetMapping("/expertReg")
-    public void expertReg(@RequestParam("doc") String doc, HttpServletResponse response) {
-        String today = DateUtil.today();
-        String docDept = dao.getDocDept(doc);
-        List<String> mzyList = dao.getMzrDeptList(doc);
-        String dept;
-        if (null == mzyList || mzyList.isEmpty()) {
-            dept = docDept;
-        } else {
-            if (mzyList.contains(docDept)) {
-                dept = docDept;
-            } else {
-                dept = mzyList.get(0);
-            }
+    @GetMapping("/hashPathEntry")
+    public void hashPathEntry(@RequestParam("path") String path, HttpServletResponse response) {
+        if (path.startsWith("selfMachineLogin")) {
+            String id = path.split("_")[1];
+            dao.deleteOldLoginRecord(id);
+            dao.insertSelfMachineLogin(id);
         }
-
-        String path = "doctorArrangement_" + today + "_" + dept + "_" + doc;
+        // 推荐人预约挂号链接(hash路由)。2801为推荐人工号,根据真实情况自行修改。
+        // https://huaihai-tech.com/wxservice/hashPathEntry?path=appointment_recStaff-2801
         try {
             response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?" +
-                    "appid=wx85bf3fd255d86750&redirect_uri=https://huaihai-tech.com/wxserver/redirect/page2?" +
+                    "appid=wx85bf3fd255d86750&redirect_uri=https://huaihai-tech.com/wxserver/redirect/hashPage2?" +
                     "to=" + path + "&response_type=code&scope=snsapi_base&state=1#wechat_redirect");
         } catch (IOException e) {
             throw new RuntimeException(e);