From 58ab4271104d402b7f44e2791b557b24c737a050 Mon Sep 17 00:00:00 2001 From: yz <82323082@qq.com> Date: Mon, 9 Jan 2023 23:28:24 +0800 Subject: [PATCH] =?UTF-8?q?perf=EF=BC=9AglobalConfig=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0redirect=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/controller/TestController.java | 15 ++++++-- .../resources/static/mobile/v1.0.0/index.html | 37 +++++++++++++++++++ .../resources/static/mobile/v1.0.1/index.html | 37 +++++++++++++++++++ .../tiesheng/util/config/GlobalConfig.java | 28 ++++++++++++++ 4 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 tiesheng-ademo/src/main/resources/static/mobile/v1.0.0/index.html create mode 100644 tiesheng-ademo/src/main/resources/static/mobile/v1.0.1/index.html diff --git a/tiesheng-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java b/tiesheng-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java index 85ed11d..e4bc2a7 100644 --- a/tiesheng-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java +++ b/tiesheng-ademo/src/main/java/com/tiesheng/demo/controller/TestController.java @@ -1,14 +1,13 @@ package com.tiesheng.demo.controller; -import cn.hutool.log.LogFactory; import com.tiesheng.annotation.token.TokenIgnore; -import com.tiesheng.util.ip2region.DataBlock; -import com.tiesheng.util.ip2region.Ip2Region; +import com.tiesheng.util.config.GlobalConfig; import com.tiesheng.util.pojos.ApiResp; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.io.IOException; +import javax.servlet.http.HttpServletResponse; /** * @author hao @@ -17,6 +16,8 @@ import java.io.IOException; @RequestMapping("/test") public class TestController { + @Autowired + GlobalConfig globalConfig; @RequestMapping("/index") @TokenIgnore @@ -24,4 +25,10 @@ public class TestController { return ApiResp.respOK("hello world"); } + @RequestMapping("/redirect") + @TokenIgnore + public void redirect(HttpServletResponse response) { + globalConfig.redirect("mobile", "/test", response); + } + } diff --git a/tiesheng-ademo/src/main/resources/static/mobile/v1.0.0/index.html b/tiesheng-ademo/src/main/resources/static/mobile/v1.0.0/index.html new file mode 100644 index 0000000..451c6cf --- /dev/null +++ b/tiesheng-ademo/src/main/resources/static/mobile/v1.0.0/index.html @@ -0,0 +1,37 @@ + + +
+ + + +