支持非根目录部署

This commit is contained in:
whyour
2023-05-19 01:10:33 +08:00
parent 1377fe31aa
commit 490bdc15f6
13 changed files with 88 additions and 55 deletions
+16
View File
@@ -0,0 +1,16 @@
const baseUrl = window.__ENV__QlBaseUrl || '/';
export function modifyClientRenderOpts(memo: any) {
return {
...memo,
publicPath: baseUrl,
basename: baseUrl,
};
}
export function modifyContextOpts(memo: any) {
return {
...memo,
basename: baseUrl,
};
}
+8 -2
View File
@@ -332,8 +332,14 @@ select:-webkit-autofill:focus {
}
.ant-pro-sider-logo {
h1 {
margin-left: 5px !important;
.title {
height: 32px;
margin: 0 5px;
font-weight: 600;
font-size: 16px;
line-height: 32px;
vertical-align: middle;
animation: pro-layout-title-hide 0.3s;
}
img {
+4 -4
View File
@@ -280,11 +280,10 @@ export default function () {
selectedKeys={[location.pathname]}
loading={loading}
ErrorBoundary={Sentry.ErrorBoundary}
logo={<Image preview={false} src="https://qn.whyour.cn/logo.png" />}
// @ts-ignore
title={
logo={
<>
<span style={{ fontSize: 16, marginRight: 5 }}></span>
<Image preview={false} src="https://qn.whyour.cn/logo.png" />
<span className="title"></span>
<a
href={systemInfo?.changeLogLink}
target="_blank"
@@ -313,6 +312,7 @@ export default function () {
</a>
</>
}
title={false}
menuItemRender={(menuItemProps: any, defaultDom: any) => {
if (
menuItemProps.isUrl ||
+3 -3
View File
@@ -17,9 +17,9 @@ const Error = () => {
needLoading && setLoading(true);
request
.get(`${config.apiPrefix}public/health`)
.then(({ error, status }) => {
if (status === 1) {
return reloadUser();
.then(({ error, data }) => {
if (data?.status === 1) {
return;
}
if (retryTimes.current > 3) {
setData(error?.details);
+3 -1
View File
@@ -1,6 +1,8 @@
const baseUrl = window.__ENV__QlBaseUrl || '/';
export default {
siteName: '青龙',
apiPrefix: '/api/',
apiPrefix: `${baseUrl}api/`,
authKey: 'token',
/* Layout configuration, specify which layout to use for route. */