mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
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:
parent
e1889ef502
commit
27f788f132
@ -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}}';
|
||||
|
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user