forked from github/dataease
Merge pull request #8144 from dataease/pr@dev@fix_water-init
fix(仪表板): 修复社区板仪表板因不支持水印设置导致的控制台报错问题
This commit is contained in:
commit
5904fbf0a3
@ -1,6 +1,8 @@
|
|||||||
package io.dataease.substitute.permissions.user;
|
package io.dataease.substitute.permissions.user;
|
||||||
|
|
||||||
|
|
||||||
|
import io.dataease.api.permissions.user.vo.UserFormVO;
|
||||||
|
import io.dataease.utils.IPUtils;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -25,4 +27,15 @@ public class SubstituteUserServer {
|
|||||||
result.put("language", "zh-CN");
|
result.put("language", "zh-CN");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@GetMapping("/personInfo")
|
||||||
|
public UserFormVO personInfo() {
|
||||||
|
UserFormVO userFormVO = new UserFormVO();
|
||||||
|
userFormVO.setId(1L);
|
||||||
|
userFormVO.setAccount("admin");
|
||||||
|
userFormVO.setName("管理员");
|
||||||
|
userFormVO.setIp(IPUtils.get());
|
||||||
|
// 当前模式为无XPack
|
||||||
|
userFormVO.setModel("lose");
|
||||||
|
return userFormVO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
|||||||
isMainCanvas(canvasId.value)
|
isMainCanvas(canvasId.value)
|
||||||
) {
|
) {
|
||||||
const scale = dashboardActive.value ? 1 : curScale.value
|
const scale = dashboardActive.value ? 1 : curScale.value
|
||||||
if (userInfo.value) {
|
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||||
activeWatermark(
|
activeWatermark(
|
||||||
dvInfo.value.watermarkInfo.settingContent,
|
dvInfo.value.watermarkInfo.settingContent,
|
||||||
userInfo.value,
|
userInfo.value,
|
||||||
@ -235,6 +235,7 @@ const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
|||||||
const method = personInfoApi
|
const method = personInfoApi
|
||||||
method().then(res => {
|
method().then(res => {
|
||||||
userInfo.value = res.data
|
userInfo.value = res.data
|
||||||
|
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||||
activeWatermark(
|
activeWatermark(
|
||||||
dvInfo.value.watermarkInfo.settingContent,
|
dvInfo.value.watermarkInfo.settingContent,
|
||||||
userInfo.value,
|
userInfo.value,
|
||||||
@ -243,6 +244,7 @@ const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
|||||||
dvInfo.value.selfWatermarkStatus,
|
dvInfo.value.selfWatermarkStatus,
|
||||||
scale
|
scale
|
||||||
)
|
)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ const initRefreshTimer = () => {
|
|||||||
|
|
||||||
const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
||||||
if (dvInfo.value.watermarkInfo && isMainCanvas(canvasId.value)) {
|
if (dvInfo.value.watermarkInfo && isMainCanvas(canvasId.value)) {
|
||||||
if (userInfo.value) {
|
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||||
activeWatermark(
|
activeWatermark(
|
||||||
dvInfo.value.watermarkInfo.settingContent,
|
dvInfo.value.watermarkInfo.settingContent,
|
||||||
userInfo.value,
|
userInfo.value,
|
||||||
@ -203,6 +203,7 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
|||||||
const method = personInfoApi
|
const method = personInfoApi
|
||||||
method().then(res => {
|
method().then(res => {
|
||||||
userInfo.value = res.data
|
userInfo.value = res.data
|
||||||
|
if (userInfo.value && userInfo.value.model !== 'lose') {
|
||||||
activeWatermark(
|
activeWatermark(
|
||||||
dvInfo.value.watermarkInfo.settingContent,
|
dvInfo.value.watermarkInfo.settingContent,
|
||||||
userInfo.value,
|
userInfo.value,
|
||||||
@ -211,6 +212,7 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => {
|
|||||||
dvInfo.value.selfWatermarkStatus,
|
dvInfo.value.selfWatermarkStatus,
|
||||||
scaleWidth.value / 100
|
scaleWidth.value / 100
|
||||||
)
|
)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,7 @@ public class UserFormVO implements Serializable {
|
|||||||
|
|
||||||
@Schema(description = "IP")
|
@Schema(description = "IP")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
@Schema(description = "模式")
|
||||||
|
private String model;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user