perf: 支持反向代理增加contextPath路径

pull/409/head
xiaojunnuo 2025-04-25 18:04:59 +08:00
parent b3468cf7f2
commit 0088929622
11 changed files with 21 additions and 22 deletions

View File

@ -1,12 +1,12 @@
VITE_APP_API=/api VITE_APP_API=api
#登录与权限关闭 #登录与权限关闭
VITE_APP_PM_ENABLED=true VITE_APP_PM_ENABLED=true
VITE_APP_TITLE=Certd VITE_APP_TITLE=Certd
VITE_APP_SLOGAN=让你的证书永不过期 VITE_APP_SLOGAN=让你的证书永不过期
VITE_APP_COPYRIGHT_YEAR=2021-2024 VITE_APP_COPYRIGHT_YEAR=2021-2025
VITE_APP_COPYRIGHT_NAME=handsfree.work VITE_APP_COPYRIGHT_NAME=handsfree.work
VITE_APP_COPYRIGHT_URL=https://certd.handsfree.work VITE_APP_COPYRIGHT_URL=https://certd.handsfree.work
VITE_APP_LOGO=/static/images/logo/logo.svg VITE_APP_LOGO=static/images/logo/logo.svg
VITE_APP_LOGIN_LOGO=/static/images/logo/rect-black.svg VITE_APP_LOGIN_LOGO=static/images/logo/rect-black.svg
VITE_APP_PROJECT_PATH=https://github.com/certd/certd VITE_APP_PROJECT_PATH=https://github.com/certd/certd
VITE_APP_NAMESPACE=fs VITE_APP_NAMESPACE=fs

View File

@ -1,3 +1,3 @@
VITE_APP_API=/api VITE_APP_API=api
#登录与权限开启 #登录与权限开启
VITE_APP_PM_ENABLED=true VITE_APP_PM_ENABLED=true

View File

@ -2,11 +2,11 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<link rel="icon" href="/api/app/favicon"/> <link rel="icon" href="api/app/favicon"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Loading</title> <title>Loading</title>
<script src="/static/icons/iconfont.js"></script> <script src="static/icons/iconfont.js?v=<%=version%>"></script>
<link rel="stylesheet" type="text/css" href="/static/index.css"/> <link rel="stylesheet" type="text/css" href="static/index.css?v=<%=version%>"/>
</head> </head>
<body> <body>
<div id="app"> <div id="app">

View File

@ -21,6 +21,6 @@ const props = defineProps<{
}>(); }>();
const nslookupCmd = computed(() => { const nslookupCmd = computed(() => {
return `nslookup -qa=txt _acme-challenge.${props.record.domain}`; return `nslookup -q=txt _acme-challenge.${props.record.domain}`;
}); });
</script> </script>

View File

@ -161,10 +161,10 @@ export const useSettingStore = defineStore({
//@ts-ignore //@ts-ignore
if (this.isComm) { if (this.isComm) {
if (siteInfo.logo) { if (siteInfo.logo) {
siteInfo.logo = `/api/basic/file/download?key=${siteInfo.logo}`; siteInfo.logo = `api/basic/file/download?key=${siteInfo.logo}`;
} }
if (siteInfo.loginLogo) { if (siteInfo.loginLogo) {
siteInfo.loginLogo = `/api/basic/file/download?key=${siteInfo.loginLogo}`; siteInfo.loginLogo = `api/basic/file/download?key=${siteInfo.loginLogo}`;
} }
} }
this.siteInfo = _.merge({}, defaultSiteInfo, siteInfo); this.siteInfo = _.merge({}, defaultSiteInfo, siteInfo);

View File

@ -7,7 +7,7 @@
<a-descriptions title="" bordered> <a-descriptions title="" bordered>
<a-descriptions-item label="用户名">{{ userInfo.username }}</a-descriptions-item> <a-descriptions-item label="用户名">{{ userInfo.username }}</a-descriptions-item>
<a-descriptions-item label="头像"> <a-descriptions-item label="头像">
<a-avatar v-if="userInfo.avatar" size="large" :src="'/api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar> <a-avatar v-if="userInfo.avatar" size="large" :src="'api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar>
<a-avatar v-else size="large" style="background-color: #00b4f5"> <a-avatar v-else size="large" style="background-color: #00b4f5">
{{ userInfo.username }} {{ userInfo.username }}
</a-avatar> </a-avatar>

View File

@ -3,7 +3,7 @@
<div class="header-profile flex-wrap bg-white dark:bg-black"> <div class="header-profile flex-wrap bg-white dark:bg-black">
<div class="flex flex-1"> <div class="flex flex-1">
<div class="avatar"> <div class="avatar">
<a-avatar v-if="userInfo.avatar" size="large" :src="'/api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar> <a-avatar v-if="userInfo.avatar" size="large" :src="'api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar>
<a-avatar v-else size="large" style="background-color: #00b4f5"> <a-avatar v-else size="large" style="background-color: #00b4f5">
{{ userInfo.username }} {{ userInfo.username }}
</a-avatar> </a-avatar>

View File

@ -28,7 +28,7 @@ function onChange(value: string) {
const imageCodeUrl = ref(); const imageCodeUrl = ref();
function resetImageCode() { function resetImageCode() {
const randomStr = nanoid(10); const randomStr = nanoid(10);
let url = "/api/basic/code/captcha"; let url = "api/basic/code/captcha";
imageCodeUrl.value = url + "?randomStr=" + randomStr; imageCodeUrl.value = url + "?randomStr=" + randomStr;
emit("update:randomStr", randomStr); emit("update:randomStr", randomStr);
} }

View File

@ -164,7 +164,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
width: "auto", width: "auto",
}, },
buildUrl(key: string) { buildUrl(key: string) {
return `/api/basic/file/download?&key=` + key; return `api/basic/file/download?&key=` + key;
}, },
}, },
}, },
@ -190,7 +190,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
}, },
}, },
buildUrl(key: string) { buildUrl(key: string) {
return `/api/basic/file/download?&key=` + key; return `api/basic/file/download?&key=` + key;
}, },
}, },
}, },

View File

@ -21,9 +21,9 @@ export default ({ command, mode }) => {
const env = loadEnv(mode, process.cwd()); const env = loadEnv(mode, process.cwd());
const devServerFs: any = {}; const devServerFs: any = {};
const devAlias: any[] = []; const devAlias: any[] = [];
const base = "/"; const base = "./";
// if (mode.startsWith("dev")) { // if (mode.startsWith("dev")) {
// base = "/dev"; // base = "./";
// } // }
return { return {
base: base, base: base,
@ -36,6 +36,7 @@ export default ({ command, mode }) => {
data: { data: {
title: env.VITE_APP_TITLE, title: env.VITE_APP_TITLE,
projectPath: env.VITE_APP_PROJECT_PATH, projectPath: env.VITE_APP_PROJECT_PATH,
version: env.VITE_APP_VERSION,
}, },
}, },
}), }),

View File

@ -87,15 +87,13 @@ export class AliyunDnsProvider extends AbstractDnsProvider {
// } // }
async createRecord(options: CreateRecordOptions): Promise<any> { async createRecord(options: CreateRecordOptions): Promise<any> {
const { fullRecord, value, type, domain } = options; const { fullRecord,hostRecord, value, type, domain } = options;
this.logger.info('添加域名解析:', fullRecord, value, domain); this.logger.info('添加域名解析:', fullRecord, value, domain);
// const domain = await this.matchDomain(fullRecord); // const domain = await this.matchDomain(fullRecord);
const rr = fullRecord.replace('.' + domain, '');
const params = { const params = {
RegionId: 'cn-hangzhou', RegionId: 'cn-hangzhou',
DomainName: domain, DomainName: domain,
RR: rr, RR: hostRecord,
Type: type, Type: type,
Value: value, Value: value,
// Line: 'oversea' // 海外 // Line: 'oversea' // 海外