chore(frontend): 清理旧前端加载接口及配置

This commit is contained in:
xuwei-fit2cloud
2026-09-24 13:25:11 +08:00
committed by fit2cloud-chenyw
parent 90b75a5cbf
commit 09cb0dc981
6 changed files with 9 additions and 20 deletions

View File

@@ -14,7 +14,7 @@ export default {
build: {
cssCodeSplit: false,
rollupOptions: {
external: id => /de-xpack/.test(id) || /extensions/.test(id),
external: id => /extensions/.test(id),
output: {
// 用于命名代码拆分时创建的共享块的输出命名
chunkFileNames: `assets/chunk/[name]-${pkg.version}-${pkg.name}.js`,

View File

@@ -1,10 +1,6 @@
import request from '@/config/axios'
export const load = (key: string) => request.get({ url: `/xpackComponent/content/${key}` })
export const loadPluginApi = (key: string) =>
request.get({ url: `/xpackComponent/contentPlugin/${key}` })
export const loadDistributed = () => request.get({ url: '/DEXPack.umd.js' })
export const xpackModelApi = () => request.get({ url: '/xpackModel' })

View File

@@ -190,16 +190,13 @@ service.interceptors.response.use(
} else if (response.config.url.match(/^\/map|geo\/\d{3}\/\d+\.json$/)) {
// TODO 处理静态文件
return response
} else if (
response.config.url.includes('DEXPack.umd.js') ||
response.config.url.includes('/i18n/custom_')
) {
} else if (response.config.url.includes('/i18n/custom_')) {
return response
} else if (response.config.url.startsWith('/xpackComponent/pluginStaticInfo/extensions-')) {
return response
} else {
if (
!response?.config?.url.startsWith('/xpackComponent/content') &&
!response?.config?.url.startsWith('/xpackComponent/contentPlugin/') &&
response?.data?.code !== 60003
) {
let errMsg = response.data.msg
@@ -220,9 +217,9 @@ service.interceptors.response.use(
}
router.push(`/login?redirect=${queryRedirectPath}`)
}
} else if (response?.config?.url.startsWith('/xpackComponent/content')) {
} else if (response?.config?.url.startsWith('/xpackComponent/contentPlugin/')) {
console.error(
"never mind this error about '/xpackComponent/content', just a reminder to support the official license"
"never mind this error about '/xpackComponent/contentPlugin/', just a reminder to support the official license"
)
}
@@ -253,7 +250,7 @@ service.interceptors.response.use(
}
const header = error.response?.headers as AxiosHeaders
if (
!error.config.url.startsWith('/xpackComponent/content') &&
!error.config.url.startsWith('/xpackComponent/contentPlugin/') &&
!header.has('DE-FORBIDDEN-FLAG') &&
!header.has('DE-GATEWAY-FLAG')
) {
@@ -262,9 +259,9 @@ service.interceptors.response.use(
message: error.response?.data?.msg ? error.response?.data?.msg : error.message,
showClose: true
})
} else if (error?.config?.url.startsWith('/xpackComponent/content')) {
} else if (error?.config?.url.startsWith('/xpackComponent/contentPlugin/')) {
console.error(
"never mind this error about '/xpackComponent/content', just a reminder to support the official license"
"never mind this error about '/xpackComponent/contentPlugin/', just a reminder to support the official license"
)
}

View File

@@ -80,7 +80,6 @@ const aesDecryptWithIv = (encryptedBase64: string, secretKey: string): string =>
const hmac_white_list = [
/* '/xpackModel',
'/DEXPackTs.umd.js',
'/sysParameter/requestTimeOut',
'/appearance/image/',
'/sysParameter/i18nOptions',

View File

@@ -12,9 +12,6 @@ import java.util.List;
public interface XpackComponentApi {
@GetMapping("/content/{name}")
String content(@PathVariable("name") String name);
@GetMapping("/contentPlugin/{name}")
String pluginContent(@PathVariable("name") String name);

View File

@@ -74,7 +74,7 @@ public class WhitelistUtils {
|| StringUtils.startsWithAny(requestURI, "/appearance/image/")
|| StringUtils.startsWithAny(requestURI, "/share/proxyInfo")
|| StringUtils.startsWithAny(requestURI, "/share/validate")
|| StringUtils.startsWithAny(requestURI, "/xpackComponent/content")
|| StringUtils.startsWithAny(requestURI, "/xpackComponent/contentPlugin/")
|| StringUtils.startsWithAny(requestURI, "/xpackComponent/pluginStaticInfo")
|| StringUtils.startsWithAny(requestURI, "/geo/")
|| StringUtils.startsWithAny(requestURI, "/websocket")