forked from github/dataease
feat(X-Pack): 新增插件管理菜单
This commit is contained in:
parent
771a58a06b
commit
f3d14cd7ba
@ -97,6 +97,7 @@ public class MenuManage {
|
||||
|| coreMenu.getId().equals(25L)
|
||||
|| coreMenu.getId().equals(26L)
|
||||
|| coreMenu.getId().equals(27L)
|
||||
|| coreMenu.getId().equals(28L)
|
||||
|| coreMenu.getId().equals(35L)
|
||||
|| coreMenu.getId().equals(40L)
|
||||
|| coreMenu.getId().equals(50L);
|
||||
|
@ -11,7 +11,6 @@ import io.dataease.utils.StaticResourceUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -24,6 +23,7 @@ import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -91,7 +91,7 @@ public class StaticResourceServer implements StaticResourceApi {
|
||||
} else {
|
||||
if (StringUtils.isNotEmpty(content)) {
|
||||
Files.createFile(uploadPath);
|
||||
FileCopyUtils.copy(Base64Utils.decodeFromString(content), Files.newOutputStream(uploadPath));
|
||||
FileCopyUtils.copy(Base64.getDecoder().decode(content), Files.newOutputStream(uploadPath));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -24,9 +24,10 @@ i18n_menu.summary=\u6982\u89C8
|
||||
i18n_menu.ds=\u6570\u636E\u8FDE\u63A5\u7BA1\u7406
|
||||
i18n_menu.task=\u4EFB\u52A1\u7BA1\u7406
|
||||
i18n_menu.embedded=\u5D4C\u5165\u5F0F\u7BA1\u7406
|
||||
i18n_menu.plugin=\u63D2\u4EF6\u7BA1\u7406
|
||||
i18n_menu.platform=\u5E73\u53F0\u5BF9\u63A5
|
||||
i18n_menu.appearance=\u5916\u89C2\u914D\u7F6E
|
||||
i18n_menu.sysVariable=\u7cfb\u7edf\u53d8\u91cf
|
||||
i18n_menu.sysVariable=\u7CFB\u7EDF\u53D8\u91CF
|
||||
i18n_field_name_repeat=\u6709\u91CD\u590D\u5B57\u6BB5\u540D\uFF1A
|
||||
i18n_pid_not_eq_id=\u79FB\u52A8\u76EE\u6807\u4E0D\u80FD\u662F\u81EA\u5DF1\u6216\u5B50\u76EE\u5F55
|
||||
i18n_ds_name_exists=\u8BE5\u5206\u7EC4\u4E0B\u540D\u79F0\u91CD\u590D
|
||||
@ -42,7 +43,7 @@ i18n_table_duplicate=\u76F8\u540C\u8282\u70B9\u9700\u91CD\u65B0\u62D6\u5165\u624
|
||||
i18n_no_column_permission=\u6CA1\u6709\u5217\u6743\u9650
|
||||
i18n_fetch_error=SQL\u6267\u884C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8868\u3001\u5B57\u6BB5\u3001\u5173\u8054\u5173\u7CFB\u7B49\u4FE1\u606F\u662F\u5426\u6B63\u786E\u5E76\u91CD\u65B0\u7F16\u8F91\u3002
|
||||
i18n_no_datasource_permission=\u65E0\u6570\u636E\u6E90\u8BBF\u95EE\u6743\u9650
|
||||
i18n_not_full=\u5f53\u524d\u6570\u636e\u6e90\u4e0d\u652f\u6301\u5168\u8fde\u63a5
|
||||
i18n_not_full=\u5F53\u524D\u6570\u636E\u6E90\u4E0D\u652F\u6301\u5168\u8FDE\u63A5
|
||||
|
||||
i18n_field_circular_ref=\u5B57\u6BB5\u5B58\u5728\u5FAA\u73AF\u5F15\u7528
|
||||
|
||||
|
3
core/core-frontend/src/assets/svg/plugin.svg
Normal file
3
core/core-frontend/src/assets/svg/plugin.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.85095 1.25927C9.38711 0.976653 8.85358 0.82917 8.31044 0.833433C7.7673 0.837697 7.23615 0.993538 6.7768 1.2834C6.31746 1.57326 5.94818 1.98563 5.71057 2.47406C5.47296 2.96248 5.37645 3.50755 5.43192 4.04786L5.43335 4.06185L5.43526 4.07579C5.48395 4.43144 5.57363 4.73928 5.67601 5.00001H3.33333C2.41286 5.00001 1.66667 5.7462 1.66667 6.66668V10H3.32144C3.32144 10 3.32145 10 3.32144 10H1.66667C1.66667 10.1187 1.67186 10.2879 1.71766 10.4532C1.76312 10.6173 1.91397 10.9897 2.35347 11.1184C2.69399 11.2182 2.97943 11.0879 3.0519 11.0548L3.05432 11.0537C3.15847 11.0062 3.26145 10.9426 3.32524 10.9032L3.35688 10.8836C3.63078 10.7141 3.9586 10.5112 4.46887 10.4383C4.69611 10.4174 4.92482 10.4591 5.13017 10.559C5.33949 10.6608 5.51622 10.8191 5.64045 11.016C5.76468 11.2128 5.83147 11.4405 5.83329 11.6732C5.83512 11.906 5.77191 12.1347 5.65079 12.3335C5.52967 12.5322 5.35545 12.6933 5.14775 12.7984C4.9466 12.9002 4.7218 12.9456 4.49717 12.9301C3.87827 12.8368 3.48951 12.6678 3.22893 12.5535L3.21333 12.5467C3.15182 12.5197 3.07479 12.4858 3.00533 12.4595C2.94691 12.4374 2.79432 12.3798 2.61337 12.3744C2.51026 12.3713 2.36131 12.3833 2.20175 12.4563C2.0319 12.5339 1.90199 12.657 1.81475 12.7961C1.67718 13.0156 1.6674 13.2412 1.66672 13.3333L1.66667 13.3497V16.6667C1.66667 17.5872 2.41286 18.3333 3.33333 18.3333H13.3333C14.2538 18.3333 15 17.5872 15 16.6667V14.3726C15.2634 14.4528 15.5783 14.529 15.9496 14.5832L15.9736 14.5866L15.9977 14.5887C16.5389 14.6357 17.0823 14.5307 17.567 14.2854C18.0516 14.0402 18.4581 13.6645 18.7407 13.2006C19.0234 12.7368 19.1708 12.2032 19.1666 11.6601C19.1623 11.117 19.0065 10.5858 18.7166 10.1265C18.4267 9.66713 18.0144 9.29786 17.526 9.06024C17.0375 8.82263 16.4925 8.72612 15.9521 8.78159L15.9382 8.78302L15.9242 8.78493C15.5684 8.83364 15.2605 8.92277 15 9.02408V6.66668C15 5.7462 14.2538 5.00001 13.3333 5.00001H11.0229C11.1031 4.73665 11.1794 4.42168 11.2335 4.05039L11.237 4.02641L11.2391 4.00227C11.286 3.46116 11.181 2.91767 10.9357 2.43304C10.6905 1.94841 10.3148 1.54189 9.85095 1.25927ZM3.33333 14.3726C3.59669 14.4529 3.91166 14.5291 4.28295 14.5832L4.30693 14.5867L4.33107 14.5888C4.87219 14.6358 5.41567 14.5307 5.9003 14.2855C6.38494 14.0402 6.79146 13.6645 7.07407 13.2007C7.35669 12.7368 7.50417 12.2033 7.49991 11.6602C7.49565 11.117 7.3398 10.5859 7.04994 10.1265C6.76008 9.66718 6.34771 9.29791 5.85929 9.06029C5.37087 8.82268 4.8258 8.72617 4.28548 8.78164L4.27149 8.78307L4.25755 8.78498C3.90177 8.83369 3.59386 8.92282 3.33333 9.02413V6.66668H6.66667C6.78476 6.66668 6.95489 6.66159 7.12096 6.61518C7.2868 6.56883 7.66666 6.41267 7.7877 5.96141C7.87872 5.62205 7.74469 5.34073 7.71124 5.27053L7.70962 5.26712C7.66163 5.16614 7.59793 5.0654 7.55799 5.00223L7.54178 4.97659C7.3691 4.70371 7.16166 4.37588 7.08858 3.86445C7.06769 3.63722 7.1094 3.40852 7.20929 3.20317C7.31113 2.99385 7.46939 2.81712 7.66625 2.69289C7.86311 2.56866 8.09075 2.50188 8.32352 2.50005C8.5563 2.49822 8.78495 2.56143 8.98374 2.68255C9.18253 2.80367 9.34354 2.9779 9.44865 3.18559C9.55045 3.38674 9.59588 3.61155 9.58036 3.83618C9.48706 4.45508 9.31812 4.84384 9.20381 5.10441L9.19696 5.12001C9.16993 5.18153 9.13611 5.25854 9.1098 5.32801C9.08768 5.38644 9.03012 5.53902 9.02468 5.71997C9.02158 5.82308 9.03361 5.97204 9.10656 6.13159C9.18421 6.30144 9.30725 6.43135 9.44641 6.51859C9.68025 6.66519 9.92107 6.66668 10 6.66668H11.5068H13.3333L13.3333 9.99999C13.3333 10.1187 13.3385 10.2879 13.3843 10.4532C13.4298 10.6172 13.5806 10.9896 14.0201 11.1184C14.3607 11.2182 14.6461 11.0879 14.7186 11.0548L14.721 11.0537C14.8251 11.0062 14.9281 10.9425 14.9919 10.9031L15.0235 10.8835C15.2974 10.714 15.6253 10.5111 16.1355 10.4383C16.3628 10.4174 16.5915 10.4591 16.7968 10.559C17.0062 10.6608 17.1829 10.8191 17.3071 11.0159C17.4313 11.2128 17.4981 11.4404 17.5 11.6732C17.5018 11.906 17.4386 12.1346 17.3175 12.3334C17.1963 12.5322 17.0221 12.6932 16.8144 12.7983C16.6133 12.9001 16.3885 12.9456 16.1638 12.93C15.5449 12.8367 15.1562 12.6678 14.8956 12.5535L14.88 12.5466C14.8185 12.5196 14.7415 12.4858 14.672 12.4595C14.6136 12.4373 14.461 12.3798 14.28 12.3743C14.1769 12.3712 14.028 12.3833 13.8684 12.4562C13.6986 12.5339 13.5687 12.6569 13.4814 12.7961C13.3438 13.0156 13.334 13.2412 13.3333 13.3333V16.6667H3.33333V14.3726Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 4.3 KiB |
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 44b16d7cfc1d05167aeecad51767da723af45abd
|
||||
Subproject commit bb258796ea5e3d47b02d4d09afb378479cc1e163
|
@ -6,11 +6,9 @@ import io.dataease.model.RSAModel;
|
||||
import io.dataease.rsa.dao.entity.CoreRsa;
|
||||
import io.dataease.rsa.manage.RsaManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Base64Utils;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
@ -21,6 +19,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.security.*;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.util.Base64;
|
||||
|
||||
@Component
|
||||
public class RsaUtils {
|
||||
@ -62,7 +61,7 @@ public class RsaUtils {
|
||||
KeyFactory keyFactory = null;
|
||||
try {
|
||||
keyFactory = KeyFactory.getInstance("RSA");
|
||||
byte[] decodedKey = Base64.decodeBase64(privateKey.getBytes());
|
||||
byte[] decodedKey = Base64.getDecoder().decode(privateKey.getBytes());
|
||||
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decodedKey);
|
||||
return keyFactory.generatePrivate(keySpec);
|
||||
} catch (Exception e) {
|
||||
@ -75,7 +74,7 @@ public class RsaUtils {
|
||||
KeyFactory keyFactory = null;
|
||||
try {
|
||||
keyFactory = KeyFactory.getInstance("RSA");
|
||||
byte[] decodedKey = Base64.decodeBase64(publicKey.getBytes());
|
||||
byte[] decodedKey = Base64.getDecoder().decode(publicKey.getBytes());
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(decodedKey);
|
||||
return keyFactory.generatePublic(keySpec);
|
||||
} catch (Exception e) {
|
||||
@ -104,13 +103,13 @@ public class RsaUtils {
|
||||
}
|
||||
byte[] encryptedData = out.toByteArray();
|
||||
out.close();
|
||||
return Base64.encodeBase64String(encryptedData);
|
||||
return Base64.getEncoder().encodeToString(encryptedData);
|
||||
}
|
||||
|
||||
private static String decrypt(String data, PrivateKey privateKey) throws Exception {
|
||||
Cipher cipher = Cipher.getInstance("RSA");
|
||||
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
||||
byte[] dataBytes = Base64.decodeBase64(data);
|
||||
byte[] dataBytes = Base64.getDecoder().decode(data);
|
||||
int inputLen = dataBytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offset = 0;
|
||||
@ -132,8 +131,8 @@ public class RsaUtils {
|
||||
|
||||
public static RSAModel generate() {
|
||||
KeyPair keyPair = getKeyPair();
|
||||
String privateKey = new String(Base64.encodeBase64(keyPair.getPrivate().getEncoded()));
|
||||
String publicKey = new String(Base64.encodeBase64(keyPair.getPublic().getEncoded()));
|
||||
String privateKey = new String(Base64.getEncoder().encode(keyPair.getPrivate().getEncoded()));
|
||||
String publicKey = new String(Base64.getEncoder().encode(keyPair.getPublic().getEncoded()));
|
||||
RSAModel rsaModel = new RSAModel();
|
||||
rsaModel.setPrivateKey(privateKey);
|
||||
rsaModel.setPublicKey(publicKey);
|
||||
@ -173,7 +172,7 @@ public class RsaUtils {
|
||||
String publicKey = coreRsa.getPublicKey();
|
||||
String aesKey = coreRsa.getAesKey();
|
||||
String pk = ascEncrypt(publicKey, aesKey).replaceAll("[\\s*\t\n\r]", "");
|
||||
String separator = Base64Utils.encodeToUrlSafeString(PK_SEPARATOR.getBytes(StandardCharsets.UTF_8));
|
||||
String separator = Base64.getUrlEncoder().encodeToString(PK_SEPARATOR.getBytes(StandardCharsets.UTF_8));
|
||||
return pk + separator + aesKey;
|
||||
}
|
||||
|
||||
@ -184,24 +183,17 @@ public class RsaUtils {
|
||||
}
|
||||
|
||||
private static String ascEncrypt(String message, String key) {
|
||||
/*byte[] baseKey = key.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] ivBytes = IV_KEY.getBytes(StandardCharsets.UTF_8);
|
||||
AES aes = new AES("CBC", "PKCS7Padding", baseKey, ivBytes);
|
||||
byte[] messageBytes = message.getBytes(StandardCharsets.UTF_8);
|
||||
return Base64Utils.encodeToString(aes.encrypt(messageBytes));*/
|
||||
|
||||
Cipher cipher = null;
|
||||
try {
|
||||
byte[] baseKey = key.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] ivBytes = IV_KEY.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] messageBytes = message.getBytes(StandardCharsets.UTF_8);
|
||||
cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
|
||||
// 根据secretKey(密钥)的字节内容,"恢复"秘钥对象
|
||||
SecretKey keySpec = new SecretKeySpec(baseKey, "AES");
|
||||
IvParameterSpec ivps = new IvParameterSpec(ivBytes);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivps);
|
||||
byte[] data = cipher.doFinal(messageBytes);
|
||||
return Base64.encodeBase64String(data);
|
||||
return Base64.getEncoder().encodeToString(data);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
|
@ -3,11 +3,11 @@ package io.dataease.utils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.Base64Utils;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Base64;
|
||||
|
||||
import static io.dataease.constant.StaticResourceConstants.*;
|
||||
|
||||
@ -86,7 +86,7 @@ public class StaticResourceUtils {
|
||||
}
|
||||
// Encode byte array as Base64
|
||||
if (buffer != null) {
|
||||
return Base64Utils.encodeToString(buffer);
|
||||
return Base64.getEncoder().encodeToString(buffer);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user