mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-04-20 19:56:17 +00:00
Added full support for the app-prefix parameter
This commit is contained in:
@@ -6,10 +6,14 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="application-name" content="WGDashboard">
|
||||
<meta name="apple-mobile-web-app-title" content="WGDashboard">
|
||||
<link rel="manifest" href="/json/manifest.json">
|
||||
<link rel="icon" href="/img/Logo-2-512x512.png">
|
||||
<base href="{{ APP_PREFIX if APP_PREFIX else '' }}/">
|
||||
<link rel="manifest" href="./json/manifest.json">
|
||||
<link rel="icon" href="./img/Logo-2-512x512.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>WGDashboard</title>
|
||||
<script>
|
||||
window.APP_PREFIX = "{{ APP_PREFIX if APP_PREFIX else '' }}";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -27,8 +27,11 @@ export const getUrl = (url) => {
|
||||
if (apiKey){
|
||||
return `${apiKey.host}${url}`
|
||||
}
|
||||
return import.meta.env.MODE === 'development' ? url
|
||||
: `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
|
||||
if (import.meta.env.MODE === 'development') {
|
||||
return url;
|
||||
}
|
||||
const appPrefix = window.APP_PREFIX || '';
|
||||
return `${window.location.protocol}//${window.location.host}${appPrefix}${url}`;
|
||||
}
|
||||
|
||||
export const fetchGet = async (url, params=undefined, callback=undefined) => {
|
||||
|
||||
@@ -32,7 +32,7 @@ export default defineConfig(({mode}) => {
|
||||
}
|
||||
|
||||
return {
|
||||
base: "/static/dist/WGDashboardAdmin",
|
||||
base: "./",
|
||||
plugins: [
|
||||
vue(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user