openRepoPortalV2打包命名修改
This commit is contained in:
2
.env.loc
2
.env.loc
@@ -39,7 +39,7 @@ VITE_USER_CENTER_HOST = 'https://local.gitcode.net:8002'
|
|||||||
# ai-copilot 子应用
|
# ai-copilot 子应用
|
||||||
VITE_COPILOT_HOST = 'https://local.gitcode.net:8003/child/aichat-app'
|
VITE_COPILOT_HOST = 'https://local.gitcode.net:8003/child/aichat-app'
|
||||||
|
|
||||||
VITE_BASE_URL=/openRepoPortal/
|
VITE_BASE_URL=/openRepoPortalV2/
|
||||||
|
|
||||||
# AI大模型接口地址
|
# AI大模型接口地址
|
||||||
VITE_AI_API_HOST = 'http://222.20.126.208:8089'
|
VITE_AI_API_HOST = 'http://222.20.126.208:8089'
|
||||||
|
|||||||
2
.env.pre
2
.env.pre
@@ -37,7 +37,7 @@ VITE_USER_CENTER_HOST = 'https://pre-usercenter-app.gitcode.com'
|
|||||||
# ai-copilot 子应用
|
# ai-copilot 子应用
|
||||||
VITE_COPILOT_HOST = 'https://pre-copilot-app.gitcode.com'
|
VITE_COPILOT_HOST = 'https://pre-copilot-app.gitcode.com'
|
||||||
|
|
||||||
VITE_BASE_URL=/openRepoPortal/
|
VITE_BASE_URL=/openRepoPortalV2/
|
||||||
|
|
||||||
# AI大模型接口地址
|
# AI大模型接口地址
|
||||||
VITE_AI_API_HOST = 'http://222.20.126.208:8089'
|
VITE_AI_API_HOST = 'http://222.20.126.208:8089'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
VITE_ENV = 'production'
|
VITE_ENV = 'production'
|
||||||
|
|
||||||
# 主域名
|
# 主域名
|
||||||
VITE_HOST = 'http://222.20.126.217:10010/openRepoPortal'
|
VITE_HOST = 'http://222.20.126.217:10010/openRepoPortalV2'
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_HOST = '/gateway/official'
|
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_ORG_COMMUNITY = 'https://gitcode.com'
|
||||||
|
|
||||||
# 静态资源域名
|
# 静态资源域名
|
||||||
VITE_STATIC_HOST = 'http://222.20.126.217:10010/openRepoPortal'
|
VITE_STATIC_HOST = 'http://222.20.126.217:10010/openRepoPortalV2'
|
||||||
|
|
||||||
# 主页搜索子应用
|
# 主页搜索子应用
|
||||||
VITE_CHILD_HOMEWEB_HOST = 'https://homepage-app.gitcode.com'
|
VITE_CHILD_HOMEWEB_HOST = 'https://homepage-app.gitcode.com'
|
||||||
@@ -37,7 +37,7 @@ VITE_USER_CENTER_HOST = 'https://usercenter-app.gitcode.com'
|
|||||||
# ai-copilot 子应用
|
# ai-copilot 子应用
|
||||||
VITE_COPILOT_HOST = 'https://copilot-app.gitcode.com'
|
VITE_COPILOT_HOST = 'https://copilot-app.gitcode.com'
|
||||||
|
|
||||||
VITE_BASE_URL=/openRepoPortal/
|
VITE_BASE_URL=/openRepoPortalV2/
|
||||||
|
|
||||||
# AI大模型接口地址
|
# AI大模型接口地址
|
||||||
VITE_AI_API_HOST = 'http://222.20.126.208:8087'
|
VITE_AI_API_HOST = 'http://222.20.126.208:8087'
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -12,7 +12,7 @@ lerna-debug.log*
|
|||||||
node_modules
|
node_modules
|
||||||
.DS_Store
|
.DS_Store
|
||||||
dist
|
dist
|
||||||
openRepoPortal
|
openRepoPortalV2
|
||||||
nginx
|
nginx
|
||||||
dist-ssr
|
dist-ssr
|
||||||
coverage
|
coverage
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "gitcode-v2",
|
"name": "openRepoPortalV2",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ onMounted(() => {
|
|||||||
/** mobile暂定全部重定向为首页 */
|
/** mobile暂定全部重定向为首页 */
|
||||||
addEventListener('notice', toNotice);
|
addEventListener('notice', toNotice);
|
||||||
window.addEventListener('message', (event) => {
|
window.addEventListener('message', (event) => {
|
||||||
let VITE_HOST = window.location.origin + '/openRepoPortal';
|
let VITE_HOST = window.location.origin + '/openRepoPortalV2';
|
||||||
// if (event.origin === (import.meta as any).env.VITE_HOST) {
|
// if (event.origin === (import.meta as any).env.VITE_HOST) {
|
||||||
if (event.origin === VITE_HOST) {
|
if (event.origin === VITE_HOST) {
|
||||||
if (event.data.type === 'success') {
|
if (event.data.type === 'success') {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import error404 from './data/error-404.json';
|
|||||||
import error503 from './data/error-503.json';
|
import error503 from './data/error-503.json';
|
||||||
|
|
||||||
// lottie动画图片资源路径
|
// lottie动画图片资源路径
|
||||||
export const assetsPath = `/openRepoPortal/static/images/`;
|
export const assetsPath = `/openRepoPortalV2/static/images/`;
|
||||||
|
|
||||||
export const defaultRender = 'canvas';
|
export const defaultRender = 'canvas';
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export const injectRouter = (router) => {
|
|||||||
|
|
||||||
// 上报ref设置
|
// 上报ref设置
|
||||||
// const BASE_URL = (import.meta as any).env.VITE_HOST;
|
// const BASE_URL = (import.meta as any).env.VITE_HOST;
|
||||||
const BASE_URL = window.location.origin + '/openRepoPortal';
|
const BASE_URL = window.location.origin + '/openRepoPortalV2';
|
||||||
const beforeRef = sessionStorage.getItem('ref');
|
const beforeRef = sessionStorage.getItem('ref');
|
||||||
const ref = beforeRef || document.referrer || '';
|
const ref = beforeRef || document.referrer || '';
|
||||||
if (!fromHomeWeb.includes(to.name)) {
|
if (!fromHomeWeb.includes(to.name)) {
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ export const messageError = ({ error_message, message }) => Message.error(error_
|
|||||||
|
|
||||||
export const savePageRef = (fullPath:string) => {
|
export const savePageRef = (fullPath:string) => {
|
||||||
// const BASE_URL = (import.meta as any).env.VITE_HOST;
|
// const BASE_URL = (import.meta as any).env.VITE_HOST;
|
||||||
const BASE_URL = window.location.origin + '/openRepoPortal';
|
const BASE_URL = window.location.origin + '/openRepoPortalV2';
|
||||||
const beforeRef = sessionStorage.getItem('ref');
|
const beforeRef = sessionStorage.getItem('ref');
|
||||||
const ref = beforeRef || document.referrer || '';
|
const ref = beforeRef || document.referrer || '';
|
||||||
window.page_ref = ref;
|
window.page_ref = ref;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const emitEvents = (type: 'success' | 'fail' = 'success', error_info?: string, p
|
|||||||
// 登录后回到登录前页面 hack一下automgit跳转
|
// 登录后回到登录前页面 hack一下automgit跳转
|
||||||
if (route.query?.installation_id) {
|
if (route.query?.installation_id) {
|
||||||
// window.location.href = `${(import.meta as any).env.VITE_HOST}${path || '/'}`;
|
// window.location.href = `${(import.meta as any).env.VITE_HOST}${path || '/'}`;
|
||||||
window.location.href = `${window.location.origin}/openRepoPortal${path || '/'}`;
|
window.location.href = `${window.location.origin}/openRepoPortalV2${path || '/'}`;
|
||||||
} else {
|
} else {
|
||||||
url && localStorage.removeItem('loginReturnUrl');
|
url && localStorage.removeItem('loginReturnUrl');
|
||||||
url ? window.location.href = url : router.replace('/');
|
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' ? '' : '你已取消授权',
|
message: error_info || type === 'success' ? '' : '你已取消授权',
|
||||||
path
|
path
|
||||||
// }, (import.meta as any).env.VITE_HOST);
|
// }, (import.meta as any).env.VITE_HOST);
|
||||||
}, window.location.origin + '/openRepoPortal');
|
}, window.location.origin + '/openRepoPortalV2');
|
||||||
window?.close();
|
window?.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const login = () => {
|
|||||||
} else {
|
} else {
|
||||||
const type = loginType.includes(route?.query?.type) ? route?.query?.type : 'csdn';
|
const type = loginType.includes(route?.query?.type) ? route?.query?.type : 'csdn';
|
||||||
// const returnUrl = `${(import.meta as any).env.VITE_HOST}${redirectUrl}`;
|
// const returnUrl = `${(import.meta as any).env.VITE_HOST}${redirectUrl}`;
|
||||||
const returnUrl = `${window.location.origin}/openRepoPortal${redirectUrl}`;
|
const returnUrl = `${window.location.origin}/openRepoPortalV2${redirectUrl}`;
|
||||||
// 保存登录前页面地址
|
// 保存登录前页面地址
|
||||||
localStorage.setItem('loginReturnUrl', returnUrl || '');
|
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}`;
|
const url = `${(import.meta as any).env.VITE_API_HOST}${(import.meta as any).env.VITE_PASSPORT_PREFIX || ''}/api/v1/oauth/login/${type}`;
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ const createOrgItem = {
|
|||||||
orgUrl: {
|
orgUrl: {
|
||||||
label: '组织URL',
|
label: '组织URL',
|
||||||
// prefix: `${(import.meta as any).env.VITE_HOST}/`,
|
// prefix: `${(import.meta as any).env.VITE_HOST}/`,
|
||||||
prefix: `${window.location.origin}/openRepoPortal/`,
|
prefix: `${window.location.origin}/openRepoPortalV2/`,
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
occupied: 'namespace已被使用',
|
occupied: 'namespace已被使用',
|
||||||
ruleDesc: {
|
ruleDesc: {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default (config: any) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
outDir: 'openRepoPortal', // 将打包后的文件夹名改为 openRepoPortal
|
outDir: 'openRepoPortalV2', // 将打包后的文件夹名改为 openRepoPortal
|
||||||
// sourcemap: config.mode !== 'production',
|
// sourcemap: config.mode !== 'production',
|
||||||
minify: 'terser', // 确保使用 terser 进行压缩
|
minify: 'terser', // 确保使用 terser 进行压缩
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
@@ -83,7 +83,7 @@ export default (config: any) => {
|
|||||||
) {
|
) {
|
||||||
if (type === 'asset') {
|
if (type === 'asset') {
|
||||||
// return env.VITE_STATIC_HOST + '/' + filename;
|
// return env.VITE_STATIC_HOST + '/' + filename;
|
||||||
return `/openRepoPortal/${filename}`;
|
return `/openRepoPortalV2/${filename}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user