forked from github/dataease
Merge remote-tracking branch 'origin/v1.5' into feat_panel-mobile-layout
This commit is contained in:
commit
c98f20a0e9
@ -1,7 +1,9 @@
|
|||||||
package io.dataease.controller;
|
package io.dataease.controller;
|
||||||
|
|
||||||
|
import io.dataease.commons.exception.DEException;
|
||||||
import io.dataease.commons.license.DefaultLicenseService;
|
import io.dataease.commons.license.DefaultLicenseService;
|
||||||
import io.dataease.commons.license.F2CLicenseResponse;
|
import io.dataease.commons.license.F2CLicenseResponse;
|
||||||
|
import io.dataease.commons.utils.LogUtil;
|
||||||
import io.dataease.commons.utils.ServletUtils;
|
import io.dataease.commons.utils.ServletUtils;
|
||||||
import io.dataease.service.panel.PanelLinkService;
|
import io.dataease.service.panel.PanelLinkService;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.Cookie;
|
import javax.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping
|
@RequestMapping
|
||||||
@ -45,13 +48,15 @@ public class IndexController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/link/{index}")
|
@GetMapping("/link/{index}")
|
||||||
public String link(@PathVariable(value = "index", required = true) Long index) {
|
public void link(@PathVariable(value = "index", required = true) Long index) {
|
||||||
String url = panelLinkService.getUrlByIndex(index);
|
String url = panelLinkService.getUrlByIndex(index);
|
||||||
HttpServletResponse response = ServletUtils.response();
|
HttpServletResponse response = ServletUtils.response();
|
||||||
String param = url.substring(url.indexOf("?") + 1);
|
try {
|
||||||
Cookie cookie = new Cookie("link", param.split("=")[1]);
|
response.sendRedirect(url);
|
||||||
response.addCookie(cookie);
|
} catch (IOException e) {
|
||||||
return url;
|
LogUtil.error(e.getMessage());
|
||||||
|
DEException.throwException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user