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