From af7578ec2a701d4137712fa57dad1f62a8495573 Mon Sep 17 00:00:00 2001 From: fmk1023 Date: Fri, 5 Dec 2025 17:12:52 +0800 Subject: [PATCH] =?UTF-8?q?Tcode=E5=B9=B3=E5=8F=B0=E6=94=B9=E9=80=A0?= =?UTF-8?q?=E5=8D=87=E7=BA=A7-=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0openRepo?= =?UTF-8?q?PortalV2=E6=94=B9=E4=B8=BAtcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.loc | 2 +- .env.pre | 2 +- .env.production | 6 +++--- .gitignore | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/App.vue | 2 +- src/components/Animation/config.ts | 2 +- src/router/interceptor.ts | 2 +- src/utils/index.ts | 2 +- src/views/OAuth/callback.vue | 4 ++-- src/views/OAuth/login.vue | 2 +- src/views/Org/Create/index.vue | 2 +- vite.config.ts | 4 ++-- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.env.loc b/.env.loc index 40ffb23..58faa89 100644 --- a/.env.loc +++ b/.env.loc @@ -39,7 +39,7 @@ VITE_USER_CENTER_HOST = 'https://local.gitcode.net:8002' # ai-copilot 子应用 VITE_COPILOT_HOST = 'https://local.gitcode.net:8003/child/aichat-app' -VITE_BASE_URL=/openRepoPortalV2/ +VITE_BASE_URL=/tcode/ # AI大模型接口地址 VITE_AI_API_HOST = 'http://222.20.126.208:8089' diff --git a/.env.pre b/.env.pre index d7358c8..fe3efa5 100644 --- a/.env.pre +++ b/.env.pre @@ -37,7 +37,7 @@ VITE_USER_CENTER_HOST = 'https://pre-usercenter-app.gitcode.com' # ai-copilot 子应用 VITE_COPILOT_HOST = 'https://pre-copilot-app.gitcode.com' -VITE_BASE_URL=/openRepoPortalV2/ +VITE_BASE_URL=/tcode/ # AI大模型接口地址 VITE_AI_API_HOST = 'http://222.20.126.208:8089' diff --git a/.env.production b/.env.production index 09dacc6..06f55c7 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,7 @@ VITE_ENV = 'production' # 主域名 -VITE_HOST = 'http://222.20.126.217:10010/openRepoPortalV2' +VITE_HOST = 'http://222.20.126.217:10010/tcode' # 接口地址 VITE_API_HOST = '/gateway/official' @@ -26,7 +26,7 @@ VITE_CSDN_URL = 'https://web-api.gitcode.com/oauth/login/csdn' VITE_ORG_COMMUNITY = 'https://gitcode.com' # 静态资源域名 -VITE_STATIC_HOST = 'http://222.20.126.217:10010/openRepoPortalV2' +VITE_STATIC_HOST = 'http://222.20.126.217:10010/tcode' # 主页搜索子应用 VITE_CHILD_HOMEWEB_HOST = 'https://homepage-app.gitcode.com' @@ -37,7 +37,7 @@ VITE_USER_CENTER_HOST = 'https://usercenter-app.gitcode.com' # ai-copilot 子应用 VITE_COPILOT_HOST = 'https://copilot-app.gitcode.com' -VITE_BASE_URL=/openRepoPortalV2/ +VITE_BASE_URL=/tcode/ # AI大模型接口地址 VITE_AI_API_HOST = 'http://222.20.126.208:8087' diff --git a/.gitignore b/.gitignore index da6cf90..a929789 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ lerna-debug.log* node_modules .DS_Store dist -openRepoPortalV2 +tcode nginx dist-ssr coverage diff --git a/package-lock.json b/package-lock.json index ea31adf..23782af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "openRepoPortalV2", + "name": "tcode", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "openRepoPortalV2", + "name": "tcode", "version": "0.0.0", "dependencies": { "@devui-design/icons": "^1.4.0", diff --git a/package.json b/package.json index ebfc364..729cf58 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "openRepoPortalV2", + "name": "tcode", "version": "0.0.0", "private": true, "scripts": { diff --git a/src/App.vue b/src/App.vue index d078579..d350266 100644 --- a/src/App.vue +++ b/src/App.vue @@ -107,7 +107,7 @@ onMounted(() => { /** mobile暂定全部重定向为首页 */ addEventListener('notice', toNotice); window.addEventListener('message', (event) => { - let VITE_HOST = window.location.origin + '/openRepoPortalV2'; + let VITE_HOST = window.location.origin + '/tcode'; // if (event.origin === (import.meta as any).env.VITE_HOST) { if (event.origin === VITE_HOST) { if (event.data.type === 'success') { diff --git a/src/components/Animation/config.ts b/src/components/Animation/config.ts index af6deb7..4973c35 100644 --- a/src/components/Animation/config.ts +++ b/src/components/Animation/config.ts @@ -5,7 +5,7 @@ import error404 from './data/error-404.json'; import error503 from './data/error-503.json'; // lottie动画图片资源路径 -export const assetsPath = `/openRepoPortalV2/static/images/`; +export const assetsPath = `/tcode/static/images/`; export const defaultRender = 'canvas'; diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index 4701a7a..edd5b8c 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -78,7 +78,7 @@ export const injectRouter = (router) => { // 上报ref设置 // const BASE_URL = (import.meta as any).env.VITE_HOST; - const BASE_URL = window.location.origin + '/openRepoPortalV2'; + const BASE_URL = window.location.origin + '/tcode'; const beforeRef = sessionStorage.getItem('ref'); const ref = beforeRef || document.referrer || ''; if (!fromHomeWeb.includes(to.name)) { diff --git a/src/utils/index.ts b/src/utils/index.ts index de50cb8..c129f1a 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -410,7 +410,7 @@ export const messageError = ({ error_message, message }) => Message.error(error_ export const savePageRef = (fullPath:string) => { // const BASE_URL = (import.meta as any).env.VITE_HOST; - const BASE_URL = window.location.origin + '/openRepoPortalV2'; + const BASE_URL = window.location.origin + '/tcode'; const beforeRef = sessionStorage.getItem('ref'); const ref = beforeRef || document.referrer || ''; window.page_ref = ref; diff --git a/src/views/OAuth/callback.vue b/src/views/OAuth/callback.vue index b5dd62a..3093d02 100644 --- a/src/views/OAuth/callback.vue +++ b/src/views/OAuth/callback.vue @@ -96,7 +96,7 @@ const emitEvents = (type: 'success' | 'fail' = 'success', error_info?: string, p // 登录后回到登录前页面 hack一下automgit跳转 if (route.query?.installation_id) { // window.location.href = `${(import.meta as any).env.VITE_HOST}${path || '/'}`; - window.location.href = `${window.location.origin}/openRepoPortalV2${path || '/'}`; + window.location.href = `${window.location.origin}/tcode${path || '/'}`; } else { url && localStorage.removeItem('loginReturnUrl'); url ? window.location.href = url : router.replace('/'); @@ -121,7 +121,7 @@ const emitEvents = (type: 'success' | 'fail' = 'success', error_info?: string, p message: error_info || type === 'success' ? '' : '你已取消授权', path // }, (import.meta as any).env.VITE_HOST); - }, window.location.origin + '/openRepoPortalV2'); + }, window.location.origin + '/tcode'); window?.close(); } } diff --git a/src/views/OAuth/login.vue b/src/views/OAuth/login.vue index cfacc5a..74728b3 100644 --- a/src/views/OAuth/login.vue +++ b/src/views/OAuth/login.vue @@ -24,7 +24,7 @@ const login = () => { } else { const type = loginType.includes(route?.query?.type) ? route?.query?.type : 'csdn'; // const returnUrl = `${(import.meta as any).env.VITE_HOST}${redirectUrl}`; - const returnUrl = `${window.location.origin}/openRepoPortalV2${redirectUrl}`; + const returnUrl = `${window.location.origin}/tcode${redirectUrl}`; // 保存登录前页面地址 localStorage.setItem('loginReturnUrl', returnUrl || ''); const url = `${(import.meta as any).env.VITE_API_HOST}${(import.meta as any).env.VITE_PASSPORT_PREFIX || ''}/api/v1/oauth/login/${type}`; diff --git a/src/views/Org/Create/index.vue b/src/views/Org/Create/index.vue index cb967d6..e1a93e7 100644 --- a/src/views/Org/Create/index.vue +++ b/src/views/Org/Create/index.vue @@ -142,7 +142,7 @@ const createOrgItem = { orgUrl: { label: '组织URL', // prefix: `${(import.meta as any).env.VITE_HOST}/`, - prefix: `${window.location.origin}/openRepoPortalV2/`, + prefix: `${window.location.origin}/tcode/`, placeholder: '请输入', occupied: 'namespace已被使用', ruleDesc: { diff --git a/vite.config.ts b/vite.config.ts index f8805c2..bdd2c4a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -62,7 +62,7 @@ export default (config: any) => { }, build: { - outDir: 'openRepoPortalV2', // 将打包后的文件夹名改为 openRepoPortal + outDir: 'tcode', // 将打包后的文件夹名改为 openRepoPortal // sourcemap: config.mode !== 'production', minify: 'terser', // 确保使用 terser 进行压缩 terserOptions: { @@ -83,7 +83,7 @@ export default (config: any) => { ) { if (type === 'asset') { // return env.VITE_STATIC_HOST + '/' + filename; - return `/openRepoPortalV2/${filename}`; + return `/tcode/${filename}`; } } }