曾富康
2026-06-26 55c79d4c0e3b07e9b7b28d3a3f424decec06d498
ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/EmbeddedPageController.java
@@ -11,6 +11,7 @@
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,8 +30,12 @@
public class EmbeddedPageController {
    private static final String EMBEDDED_IFRAME_VIEW = "/system/embedded/iframe.html";
    private static final String ROUTE_SWITCH_URL = "http://192.168.110.22:8087/#/?token=";
    private static final String STATISTICAL_TABLE_URL = "http://192.168.110.22:8087/#/statistical-table?token=";
    @Value("${embedded.route-switch-url}")
    private String routeSwitchUrl;
    @Value("${embedded.statistical-table-url}")
    private String statisticalTableUrl;
    @Autowired
    private IMenuEntryConfigService menuEntryConfigService;
@@ -41,14 +46,14 @@
    @RequestMapping("/embedded/route-switch")
    public String routeSwitch(Model model) throws UnsupportedEncodingException {
        model.addAttribute("title", "路由切换页");
        model.addAttribute("iframeSrc", ROUTE_SWITCH_URL + generateCurrentUserToken());
        model.addAttribute("iframeSrc", buildTokenUrl(routeSwitchUrl));
        return EMBEDDED_IFRAME_VIEW;
    }
    @RequestMapping("/embedded/statistical-table")
    public String statisticalTable(Model model) throws UnsupportedEncodingException {
        model.addAttribute("title", "统计板");
        model.addAttribute("iframeSrc", STATISTICAL_TABLE_URL + generateCurrentUserToken());
        model.addAttribute("iframeSrc", buildTokenUrl(statisticalTableUrl));
        return EMBEDDED_IFRAME_VIEW;
    }
@@ -85,6 +90,10 @@
        return null;
    }
    private String buildTokenUrl(String baseUrl) throws UnsupportedEncodingException {
        return baseUrl + generateCurrentUserToken();
    }
    private String generateCurrentUserToken() throws UnsupportedEncodingException {
        ShiroUser user = ShiroKit.getUser();
        if (user == null || user.getId() == null) {