可信代码库-配置文件修复定向URL改为动态获取
This commit is contained in:
@@ -54,7 +54,8 @@ const { namespace } = getOrgInfo();
|
||||
const avatarUrl = '/src/assets/imgs/avatar/male.png';
|
||||
|
||||
|
||||
const VITE_GOVERNANCE_HOST = import.meta.env.VITE_GOVERNANCE_HOST;
|
||||
// const VITE_GOVERNANCE_HOST = import.meta.env.VITE_GOVERNANCE_HOST;
|
||||
const VITE_GOVERNANCE_HOST = window.location.origin + '/governancePortal';
|
||||
|
||||
const selectTab = ref('yjtzlb');
|
||||
const { accountInfo, RemoveInfo } = useAccount();
|
||||
|
||||
@@ -37,7 +37,8 @@ onMounted(async() => {
|
||||
const excRes = /(.*)_(.*)/.exec(state as string);
|
||||
if (excRes) {
|
||||
if (window.parent) {
|
||||
window.opener?.postMessage({ fn: 'otho', type, code, state: excRes[1] }, (import.meta as any).env.VITE_HOST);
|
||||
// window.opener?.postMessage({ fn: 'otho', type, code, state: excRes[1] }, (import.meta as any).env.VITE_HOST);
|
||||
window.opener?.postMessage({ fn: 'otho', type, code, state: excRes[1] }, window.location.origin + '/openRepoPortal');
|
||||
window?.close();
|
||||
}
|
||||
return;
|
||||
@@ -94,7 +95,8 @@ const emitEvents = (type: 'success' | 'fail' = 'success', error_info?: string, p
|
||||
if (type === 'success') {
|
||||
// 登录后回到登录前页面 hack一下automgit跳转
|
||||
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 || '/'}`;
|
||||
} else {
|
||||
url && localStorage.removeItem('loginReturnUrl');
|
||||
url ? window.location.href = url : router.replace('/');
|
||||
@@ -118,7 +120,8 @@ const emitEvents = (type: 'success' | 'fail' = 'success', error_info?: string, p
|
||||
type,
|
||||
message: error_info || type === 'success' ? '' : '你已取消授权',
|
||||
path
|
||||
}, (import.meta as any).env.VITE_HOST);
|
||||
// }, (import.meta as any).env.VITE_HOST);
|
||||
}, window.location.origin + '/openRepoPortal');
|
||||
window?.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ const login = () => {
|
||||
return;
|
||||
} else {
|
||||
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}`;
|
||||
// 保存登录前页面地址
|
||||
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}`;
|
||||
|
||||
@@ -141,7 +141,8 @@ const createOrgItem = {
|
||||
},
|
||||
orgUrl: {
|
||||
label: '组织URL',
|
||||
prefix: `${(import.meta as any).env.VITE_HOST}/`,
|
||||
// prefix: `${(import.meta as any).env.VITE_HOST}/`,
|
||||
prefix: `${window.location.origin}/openRepoPortal/`,
|
||||
placeholder: '请输入',
|
||||
occupied: 'namespace已被使用',
|
||||
ruleDesc: {
|
||||
|
||||
Reference in New Issue
Block a user