forked from github/dataease
fix(仪表板): 公共链接权限受当前浏览器中登录用户的权限影响
This commit is contained in:
parent
db66ebdd73
commit
47ccc4ffe0
@ -30,6 +30,7 @@ import io.dataease.exception.DEException;
|
|||||||
import io.dataease.i18n.Translator;
|
import io.dataease.i18n.Translator;
|
||||||
import io.dataease.result.ResultCode;
|
import io.dataease.result.ResultCode;
|
||||||
import io.dataease.system.manage.CorePermissionManage;
|
import io.dataease.system.manage.CorePermissionManage;
|
||||||
|
import io.dataease.utils.AuthUtils;
|
||||||
import io.dataease.utils.BeanUtils;
|
import io.dataease.utils.BeanUtils;
|
||||||
import io.dataease.utils.JsonUtil;
|
import io.dataease.utils.JsonUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -85,6 +86,10 @@ public class ChartDataManage {
|
|||||||
if (ObjectUtils.isEmpty(view)) {
|
if (ObjectUtils.isEmpty(view)) {
|
||||||
DEException.throwException(ResultCode.DATA_IS_WRONG.code(), Translator.get("i18n_chart_delete"));
|
DEException.throwException(ResultCode.DATA_IS_WRONG.code(), Translator.get("i18n_chart_delete"));
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(AuthUtils.getUser())) {
|
||||||
|
chartExtRequest.setUser(AuthUtils.getUser().getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//如果是excel导出 如果是从仪表板获取图表数据,则仪表板的查询模式,查询结果的数量,覆盖图表对应的属性
|
//如果是excel导出 如果是从仪表板获取图表数据,则仪表板的查询模式,查询结果的数量,覆盖图表对应的属性
|
||||||
if (view.getIsExcelExport()) {
|
if (view.getIsExcelExport()) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { refreshApi } from '@/api/login'
|
import { refreshApi } from '@/api/login'
|
||||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||||
|
|
||||||
|
import { isLink } from '@/utils/utils'
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
const userStore = useUserStoreWithOut()
|
const userStore = useUserStoreWithOut()
|
||||||
const refreshUrl = '/login/refresh'
|
const refreshUrl = '/login/refresh'
|
||||||
@ -39,6 +41,9 @@ export const configHandler = config => {
|
|||||||
if (desktop) {
|
if (desktop) {
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
if (isLink()) {
|
||||||
|
return config
|
||||||
|
}
|
||||||
if (wsCache.get('user.token')) {
|
if (wsCache.get('user.token')) {
|
||||||
config.headers['X-DE-TOKEN'] = wsCache.get('user.token')
|
config.headers['X-DE-TOKEN'] = wsCache.get('user.token')
|
||||||
const expired = isExpired()
|
const expired = isExpired()
|
||||||
|
@ -50,7 +50,7 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
await appearanceStore.setAppearance()
|
await appearanceStore.setAppearance()
|
||||||
if (wsCache.get('user.token') || isDesktop) {
|
if ((wsCache.get('user.token') || isDesktop) && !to.path.startsWith('/de-link/')) {
|
||||||
if (!userStore.getUid) {
|
if (!userStore.getUid) {
|
||||||
await userStore.setUser()
|
await userStore.setUser()
|
||||||
}
|
}
|
||||||
|
@ -147,3 +147,7 @@ export function cutTargetTree(tree: BusiTreeNode[], targetId: string | number) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const isLink = () => {
|
||||||
|
return window.location.hash.startsWith('#/de-link/')
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user