@nocobase/app 1.6.0-alpha.10 → 1.6.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/.umirc.ts CHANGED
@@ -20,12 +20,12 @@ export default defineConfig({
20
20
  metas: [{ name: 'viewport', content: 'initial-scale=0.1' }],
21
21
  links: [{ rel: 'stylesheet', href: `${appPublicPath}global.css` }],
22
22
  headScripts: [
23
- {
24
- src: `${appPublicPath}browser-checker.js`,
25
- },
26
23
  {
27
24
  content: isDevCmd
28
- ? ''
25
+ ? `
26
+ window['__nocobase_public_path__'] = "${process.env.APP_PUBLIC_PATH || '/'}";
27
+ window['__nocobase_dev_public_path__'] = "/";
28
+ `
29
29
  : `
30
30
  window['__webpack_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
31
31
  window['__nocobase_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
@@ -36,6 +36,9 @@ export default defineConfig({
36
36
  window['__nocobase_ws_path__'] = '{{env.WS_PATH}}';
37
37
  `,
38
38
  },
39
+ {
40
+ src: `${appPublicPath}browser-checker.js?v=1`,
41
+ },
39
42
  ],
40
43
  cacheDirectoryPath: process.env.APP_CLIENT_CACHE_DIR || `node_modules/.cache`,
41
44
  outputPath: path.resolve(__dirname, '../dist/client'),
@@ -1,3 +1,13 @@
1
+ const basename = window['__nocobase_public_path__'] || '/';
2
+ let currentPath = window.location.pathname;
3
+ if (currentPath === basename.slice(0, -1)) {
4
+ const newUrl = `${window.location.origin}${basename}${window.location.search}${window.location.hash}`;
5
+ window.location.replace(newUrl);
6
+ } else if (!currentPath.startsWith(basename)) {
7
+ let newPath = basename + (currentPath.startsWith('/') ? currentPath.slice(1) : currentPath);
8
+ let newUrl = window.location.origin + newPath + window.location.search + window.location.hash;
9
+ window.location.replace(newUrl);
10
+ }
1
11
  showLog = true;
2
12
  function log(m) {
3
13
  if (window.console && showLog) {
@@ -1,3 +1,13 @@
1
+ const basename = window['__nocobase_public_path__'] || '/';
2
+ let currentPath = window.location.pathname;
3
+ if (currentPath === basename.slice(0, -1)) {
4
+ const newUrl = `${window.location.origin}${basename}${window.location.search}${window.location.hash}`;
5
+ window.location.replace(newUrl);
6
+ } else if (!currentPath.startsWith(basename)) {
7
+ let newPath = basename + (currentPath.startsWith('/') ? currentPath.slice(1) : currentPath);
8
+ let newUrl = window.location.origin + newPath + window.location.search + window.location.hash;
9
+ window.location.replace(newUrl);
10
+ }
1
11
  showLog = true;
2
12
  function log(m) {
3
13
  if (window.console && showLog) {
@@ -5,7 +5,6 @@
5
5
  <link rel="shortcut icon" href="/favicon/favicon.ico">
6
6
  <title>Loading...</title>
7
7
  <link rel="stylesheet" href="/global.css">
8
- <script src="/browser-checker.js"></script>
9
8
  <script>
10
9
  window['__webpack_public_path__'] = '/';
11
10
  window['__nocobase_public_path__'] = '/';
@@ -15,9 +14,10 @@
15
14
  window['__nocobase_ws_url__'] = '';
16
15
  window['__nocobase_ws_path__'] = '/ws';
17
16
  </script>
17
+ <script src="/browser-checker.js?v=1"></script>
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
21
- <script src="/umi.da5c528e.js"></script>
21
+ <script src="/umi.68008233.js"></script>
22
22
 
23
23
  </body></html>
@@ -5,7 +5,6 @@
5
5
  <link rel="shortcut icon" href="{{env.APP_PUBLIC_PATH}}favicon/favicon.ico">
6
6
  <title>Loading...</title>
7
7
  <link rel="stylesheet" href="{{env.APP_PUBLIC_PATH}}global.css">
8
- <script src="{{env.APP_PUBLIC_PATH}}browser-checker.js"></script>
9
8
  <script>
10
9
  window['__webpack_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
11
10
  window['__nocobase_public_path__'] = '{{env.APP_PUBLIC_PATH}}';
@@ -15,9 +14,10 @@
15
14
  window['__nocobase_ws_url__'] = '{{env.WS_URL}}';
16
15
  window['__nocobase_ws_path__'] = '{{env.WS_PATH}}';
17
16
  </script>
17
+ <script src="{{env.APP_PUBLIC_PATH}}browser-checker.js?v=1"></script>
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
21
- <script src="/umi.da5c528e.js"></script>
21
+ <script src="/umi.68008233.js"></script>
22
22
 
23
23
  </body></html>