forked from github/dataease
Merge branch 'dev-v2' into pr@dev2@fixds
This commit is contained in:
commit
8bf1c17d3f
@ -94,7 +94,7 @@ public class ExportCenterManage {
|
||||
@Value("${dataease.export.max.size:10}")
|
||||
private int max;
|
||||
|
||||
@Value("${dataease.export.dataset.limit:100000}")
|
||||
@Value("${dataease.export.dataset.limit:20}")
|
||||
private int limit;
|
||||
private final static String DATA_URL_TITLE = "data:image/jpeg;base64,";
|
||||
private static final String exportData_path = "/opt/dataease2.0/data/exportData/";
|
||||
@ -153,7 +153,7 @@ public class ExportCenterManage {
|
||||
}
|
||||
|
||||
private Long getExportLimit() {
|
||||
return Math.min(f2CLicLimitedManage.checkDatasetLimit(),limit);
|
||||
return Math.min(f2CLicLimitedManage.checkDatasetLimit(), limit);
|
||||
}
|
||||
|
||||
public void download(String id, HttpServletResponse response) throws Exception {
|
||||
@ -395,7 +395,7 @@ public class ExportCenterManage {
|
||||
}
|
||||
if (StringUtils.isNotEmpty(request.getExpressionTree())) {
|
||||
Gson gson = new Gson();
|
||||
DatasetRowPermissionsTreeObj datasetRowPermissionsTreeObj =JsonUtil.parseObject(request.getExpressionTree(), DatasetRowPermissionsTreeObj.class);
|
||||
DatasetRowPermissionsTreeObj datasetRowPermissionsTreeObj = JsonUtil.parseObject(request.getExpressionTree(), DatasetRowPermissionsTreeObj.class);
|
||||
permissionManage.getField(datasetRowPermissionsTreeObj);
|
||||
DataSetRowPermissionsTreeDTO dataSetRowPermissionsTreeDTO = new DataSetRowPermissionsTreeDTO();
|
||||
dataSetRowPermissionsTreeDTO.setTree(datasetRowPermissionsTreeObj);
|
||||
@ -421,13 +421,15 @@ public class ExportCenterManage {
|
||||
totalCount = totalCount > curLimit ? curLimit : totalCount;
|
||||
Long totalPage = (totalCount / extractPageSize) + (totalCount % extractPageSize > 0 ? 1 : 0);
|
||||
|
||||
|
||||
Workbook wb = new SXSSFWorkbook();
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(dataPath + "/" + request.getFilename() + ".xlsx");
|
||||
Sheet detailsSheet = wb.createSheet("数据");
|
||||
|
||||
for (Integer p = 0; p < totalPage; p++) {
|
||||
String querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, p * extractPageSize, p * extractPageSize + extractPageSize);
|
||||
if (totalPage == 1) {
|
||||
querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, 0, totalCount.intValue());
|
||||
}
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setQuery(querySQL);
|
||||
|
@ -3,12 +3,20 @@ import router from '@/router'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import request from '@/config/axios'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
|
||||
export const logoutHandler = (justClean?: boolean) => {
|
||||
const idToken = wsCache.get('oauth2-id-token')
|
||||
if (idToken) {
|
||||
request.get({ url: `/oauth2/logout/${idToken}` }).finally(() => {
|
||||
wsCache.delete('oauth2-id-token')
|
||||
})
|
||||
}
|
||||
userStore.clear()
|
||||
userStore.$reset()
|
||||
permissionStore.clear()
|
||||
|
@ -16,7 +16,7 @@ import { XpackComponent } from '@/components/plugin'
|
||||
import { logoutHandler } from '@/utils/logout'
|
||||
import DeImage from '@/assets/login-desc-de.png'
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import { checkPlatform, cleanPlatformFlag } from '@/utils/utils'
|
||||
import { checkPlatform, cleanPlatformFlag, getQueryString } from '@/utils/utils'
|
||||
import xss from 'xss'
|
||||
const { wsCache } = useCache()
|
||||
const appStore = useAppStoreWithOut()
|
||||
@ -253,6 +253,8 @@ onMounted(async () => {
|
||||
} else {
|
||||
preheat.value = false
|
||||
}
|
||||
} else if (getQueryString('state')?.includes('de-oauth2-')) {
|
||||
preheat.value = true
|
||||
}
|
||||
if (localStorage.getItem('DE-GATEWAY-FLAG')) {
|
||||
const msg = localStorage.getItem('DE-GATEWAY-FLAG')
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit adfb61c3ef5171563fdcd7db101ff2aabc5556dd
|
||||
Subproject commit 8ec01af68b38419a065d57f80f915b903ddc00bb
|
@ -34,6 +34,9 @@ public interface XpackAuthenticationApi {
|
||||
@PostMapping("/save/ldap")
|
||||
String saveLdap(@RequestBody XpackLdapVO editor);
|
||||
|
||||
@PostMapping("/save/oauth2")
|
||||
String saveOauth2(@RequestBody XpackOauth2VO editor);
|
||||
|
||||
|
||||
@GetMapping("/info/oidc")
|
||||
XpackOidcVO oidcInfo();
|
||||
@ -44,6 +47,9 @@ public interface XpackAuthenticationApi {
|
||||
@GetMapping("/info/ldap")
|
||||
XpackLdapVO ldapInfo();
|
||||
|
||||
@GetMapping("/info/oauth2")
|
||||
XpackOauth2VO oauth2Info();
|
||||
|
||||
|
||||
@PostMapping("/validate/oidc")
|
||||
String validateOidc(@RequestBody XpackOidcVO editor);
|
||||
@ -54,10 +60,14 @@ public interface XpackAuthenticationApi {
|
||||
@PostMapping("/validate/ldap")
|
||||
String validateLdap(@RequestBody XpackLdapVO editor);
|
||||
|
||||
@PostMapping("/validate/oauth2")
|
||||
String validateOauth2(@RequestBody XpackOauth2VO editor);
|
||||
|
||||
@PostMapping("/validateId/{id}")
|
||||
String validate(@PathVariable("id") Long id);
|
||||
|
||||
@Operation(summary = "查询状态")
|
||||
@GetMapping("/status")
|
||||
List<XpackAuthenticationStatusVO> status();
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package io.dataease.api.xpack.settings;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.api.xpack.settings.request.XpackOauth2TokenRequest;
|
||||
import io.dataease.api.xpack.settings.vo.XpackOauthAuthVO;
|
||||
import io.dataease.api.xpack.settings.vo.XpackOauthTokenVO;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@Tag(name = "Oauth2认证")
|
||||
@ApiSupport(order = 899)
|
||||
public interface XpackOauth2Api {
|
||||
|
||||
@GetMapping("/auth")
|
||||
XpackOauthAuthVO auth();
|
||||
|
||||
@PostMapping("/token")
|
||||
XpackOauthTokenVO oauth2Token(@RequestBody XpackOauth2TokenRequest request);
|
||||
|
||||
@GetMapping("/logout/{idToken}")
|
||||
void logout(@PathVariable("idToken") String idToken);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package io.dataease.api.xpack.settings.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class XpackOauth2TokenRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 489213446985742448L;
|
||||
|
||||
private String code;
|
||||
|
||||
private String state;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package io.dataease.api.xpack.settings.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class XpackOauth2VO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2395518228048236146L;
|
||||
|
||||
private String clientId;
|
||||
|
||||
private String clientSecret;
|
||||
|
||||
private String authEndpoint;
|
||||
|
||||
private String tokenEndpoint;
|
||||
|
||||
private String userInfoEndpoint;
|
||||
|
||||
private String logoutEndpoint;
|
||||
|
||||
private String scope;
|
||||
|
||||
private String mapping;
|
||||
|
||||
private String redirectUri;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package io.dataease.api.xpack.settings.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class XpackOauthAuthVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3658093847024323465L;
|
||||
|
||||
private String state;
|
||||
|
||||
private String clientId;
|
||||
|
||||
private String redirectUri;
|
||||
|
||||
private String authEndpoint;
|
||||
|
||||
private String scope;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package io.dataease.api.xpack.settings.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class XpackOauthTokenVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3594367641594329352L;
|
||||
|
||||
private String token;
|
||||
|
||||
private String idToken;
|
||||
}
|
@ -68,6 +68,7 @@ public class WhitelistUtils {
|
||||
|| StringUtils.startsWithAny(requestURI, "/geo/")
|
||||
|| StringUtils.startsWithAny(requestURI, "/websocket")
|
||||
|| StringUtils.startsWithAny(requestURI, "/map/")
|
||||
|| StringUtils.startsWithAny(requestURI, "/oauth2/")
|
||||
|| StringUtils.startsWithAny(requestURI, "/typeface/download")
|
||||
|| StringUtils.startsWithAny(requestURI, "/typeface/defaultFont")
|
||||
|| StringUtils.startsWithAny(requestURI, "/typeface/listFont")
|
||||
|
Loading…
Reference in New Issue
Block a user