forked from github/dataease
refactor(仪表板): 优化仪表板公共链接水印展示逻辑,用户信息取分享人
This commit is contained in:
parent
1f996118e8
commit
65b6e88203
@ -122,6 +122,7 @@ public class ShiroServiceImpl implements ShiroService {
|
||||
filterChainDefinitionMap.put("/panel/group/exportDetails", ANON);
|
||||
filterChainDefinitionMap.put("/dataset/field/linkMultFieldValues", "link");
|
||||
filterChainDefinitionMap.put("/dataset/field/linkMappingFieldValues", "link");
|
||||
filterChainDefinitionMap.put("/systemInfo/proxyUserLoginInfo/**", ANON);
|
||||
|
||||
filterChainDefinitionMap.put("/**", "authc");
|
||||
|
||||
|
@ -3,6 +3,7 @@ package io.dataease.controller.sys;
|
||||
import io.dataease.dto.UserLoginInfoDTO;
|
||||
import io.dataease.service.SystemInfoService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
@ -19,6 +20,11 @@ public class SystemInfoController {
|
||||
|
||||
@GetMapping("userLoginInfo")
|
||||
public UserLoginInfoDTO userLoginInfo() throws IOException {
|
||||
return systemInfoService.getUserLoginInfo();
|
||||
return systemInfoService.getUserLoginInfo(null);
|
||||
}
|
||||
|
||||
@GetMapping("proxyUserLoginInfo/{userId}")
|
||||
public UserLoginInfoDTO proxyUserLoginInfo(@PathVariable String userId) throws IOException {
|
||||
return systemInfoService.getUserLoginInfo(userId);
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,30 @@
|
||||
package io.dataease.service;
|
||||
|
||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.commons.utils.IPUtils;
|
||||
import io.dataease.dto.UserLoginInfoDTO;
|
||||
import io.dataease.plugins.common.base.domain.SysUser;
|
||||
import io.dataease.plugins.common.base.mapper.SysUserMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Service
|
||||
public class SystemInfoService {
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
public UserLoginInfoDTO getUserLoginInfo() {
|
||||
public UserLoginInfoDTO getUserLoginInfo(String userId) {
|
||||
if (StringUtils.isNotEmpty(userId)) {
|
||||
SysUser userInfo = sysUserMapper.selectByPrimaryKey(Long.parseLong(userId));
|
||||
CurrentUserDto userDto = new CurrentUserDto();
|
||||
BeanUtils.copyBean(userDto, userInfo);
|
||||
return new UserLoginInfoDTO(userDto, IPUtils.get());
|
||||
}
|
||||
return new UserLoginInfoDTO(AuthUtils.getUser(), IPUtils.get());
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,15 @@ export function userLoginInfo() {
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
userLoginInfo
|
||||
export function proxyUserLoginInfo(userId) {
|
||||
return request({
|
||||
url: '/systemInfo/proxyUserLoginInfo/' + userId,
|
||||
method: 'get',
|
||||
loading: false
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
userLoginInfo,
|
||||
proxyUserLoginInfo
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
:style="customStyle"
|
||||
@scroll="canvasScroll"
|
||||
>
|
||||
<canvas-opt-bar />
|
||||
<canvas-opt-bar/>
|
||||
<div
|
||||
:id="previewDomId"
|
||||
:ref="previewRefId"
|
||||
@ -74,7 +74,7 @@ import bus from '@/utils/bus'
|
||||
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
|
||||
import { hasDataPermission } from '@/utils/permission'
|
||||
import { activeWatermark } from '@/components/canvas/tools/watermark'
|
||||
import { userLoginInfo } from '@/api/systemInfo/userLogin'
|
||||
import { proxyUserLoginInfo, userLoginInfo } from '@/api/systemInfo/userLogin'
|
||||
|
||||
const erd = elementResizeDetectorMaker()
|
||||
|
||||
@ -140,6 +140,10 @@ export default {
|
||||
type: String,
|
||||
require: false,
|
||||
default: 'canvas-main'
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
require: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -316,7 +320,8 @@ export default {
|
||||
methods: {
|
||||
initWatermark() {
|
||||
if (this.panelInfo.watermarkInfo) {
|
||||
userLoginInfo().then(res => {
|
||||
const method = this.userId ? proxyUserLoginInfo : userLoginInfo
|
||||
method(this.userId).then(res => {
|
||||
const userInfo = res.data
|
||||
activeWatermark(this.panelInfo.watermarkInfo.settingContent, userInfo, 'preview-main-canvas-main', this.canvasId, this.panelInfo.watermarkOpen)
|
||||
})
|
||||
|
@ -5,6 +5,7 @@
|
||||
:component-data="mainCanvasComponentData"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:panel-info="panelInfo"
|
||||
:user-id="user"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user