fix: 公共链接视图api缺少参数

This commit is contained in:
fit2cloud-chenyw 2022-03-02 11:23:25 +08:00
parent 51bda15879
commit 5c008256db
3 changed files with 9 additions and 16 deletions

View File

@ -1,6 +1,5 @@
package io.dataease.controller.panel.api;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.auth.annotation.DePermission;
import io.dataease.commons.constants.DePermissionType;
@ -19,7 +18,6 @@ import java.util.Map;
@RequestMapping("/api/link")
public interface LinkApi {
@DePermission(type = DePermissionType.PANEL, value = "resourceId")
@ApiOperation("重置密码")
@PostMapping("/resetPwd")
@ -45,7 +43,6 @@ public interface LinkApi {
@PostMapping("/currentGenerate/{resourceId}")
GenerateDto currentGenerate(String resourceId);
@ApiOperation("验证访问")
@PostMapping("/validate")
ValidateDto validate(LinkValidateRequest request) throws Exception;
@ -59,10 +56,11 @@ public interface LinkApi {
Object resourceDetail(@PathVariable String resourceId);
@ApiOperation("视图详息")
@PostMapping("/viewDetail/{viewId}")
Object viewDetail(@PathVariable String viewId, @RequestBody ChartExtRequest requestList) throws Exception;
@PostMapping("/viewDetail/{viewId}/{panelId}")
Object viewDetail(@PathVariable("viewId") String viewId, @PathVariable("panelId") String panelId,
@RequestBody ChartExtRequest requestList) throws Exception;
@ApiOperation("压缩链接")
@PostMapping("/shortUrl")
String shortUrl(@RequestBody Map<String,String> param);
String shortUrl(@RequestBody Map<String, String> param);
}

View File

@ -1,6 +1,5 @@
package io.dataease.controller.panel.server;
import com.auth0.jwt.JWT;
import com.auth0.jwt.interfaces.DecodedJWT;
import io.dataease.auth.filter.F2CLinkFilter;
@ -25,18 +24,15 @@ import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.util.Map;
@RestController
public class LinkServer implements LinkApi {
@Autowired
private PanelLinkService panelLinkService;
@Resource
private ChartViewService chartViewService;
@Override
public void replacePwd(@RequestBody PasswordRequest request) {
panelLinkService.password(request);
@ -47,7 +43,6 @@ public class LinkServer implements LinkApi {
panelLinkService.changeEnablePwd(request);
}
@Override
public void resetOverTime(@RequestBody OverTimeRequest request) {
panelLinkService.overTime(request);
@ -96,8 +91,9 @@ public class LinkServer implements LinkApi {
}
@Override
public Object viewDetail(String viewId, ChartExtRequest requestList) throws Exception {
HttpServletRequest request =((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
public Object viewDetail(String viewId, String panelId, ChartExtRequest requestList) throws Exception {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
.getRequest();
String linkToken = request.getHeader(F2CLinkFilter.LINK_TOKEN_KEY);
DecodedJWT jwt = JWT.decode(linkToken);
Long userId = jwt.getClaim("userId").asLong();
@ -105,7 +101,6 @@ public class LinkServer implements LinkApi {
return chartViewService.getData(viewId, requestList);
}
@Override
public String shortUrl(Map<String, String> param) {
String resourceId = param.get("resourceId");

View File

@ -64,9 +64,9 @@ export function loadResource(resourceId) {
})
}
export function viewInfo(id, data) {
export function viewInfo(id, panelId, data) {
return request({
url: 'api/link/viewDetail/' + id,
url: 'api/link/viewDetail/' + id + '/' + panelId,
method: 'post',
hideMsg: true,
data