fix: resolve missing public path in icon file paths (#6034)

* fix: resolve missing public path in icon file paths

* fix: error
This commit is contained in:
chenos 2025-01-10 11:07:40 +08:00 committed by GitHub
parent e1889ef502
commit 27f788f132
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,7 @@ export default defineConfig({
content: isDevCmd
? `
window['__nocobase_public_path__'] = "${process.env.APP_PUBLIC_PATH || '/'}";
window['__nocobase_dev_public_path__'] = "/";
`
: `
window['__webpack_public_path__'] = '{{env.APP_PUBLIC_PATH}}';

View File

@ -7,6 +7,8 @@
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
const publicPath = window['__nocobase_dev_public_path__'] || window['__nocobase_public_path__'] || '/';
export const UPLOAD_PLACEHOLDER = [
{
ext: /\.docx?$/i,
@ -64,6 +66,11 @@ export const UPLOAD_PLACEHOLDER = [
ext: /\.(zip|rar|arj|z|gz|iso|jar|ace|tar|uue|dmg|pkg|lzh|cab)$/i,
icon: '/file-placeholder/zip-200-200.png',
},
];
].map((item) => {
return {
ext: item.ext,
icon: publicPath + item.icon.slice(1),
};
});
export const UNKNOWN_FILE_ICON = '/file-placeholder/unknown-200-200.png';
export const UNKNOWN_FILE_ICON = publicPath + 'file-placeholder/unknown-200-200.png';