fix:修复vite打包小图片丢失的坑
This commit is contained in:
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -50,14 +50,14 @@ const userInfo = reactive({
|
||||
role: [],
|
||||
id: "",
|
||||
});
|
||||
const iconUrl = ref("../../src/assets/common/icons/logo.ico");
|
||||
const iconUrl = ref("/logo.ico");
|
||||
const iconUrlHandler = () => {
|
||||
if (
|
||||
userInfo.icon == null ||
|
||||
userInfo.icon == undefined ||
|
||||
userInfo.icon == ""
|
||||
) {
|
||||
return "../../src/assets/common/icons/logo.ico";
|
||||
return "/logo.ico";
|
||||
}
|
||||
return `${import.meta.env.VITE_APP_BASEAPI}/file/${userInfo.icon}`;
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ const useUserStore = defineStore("user", {
|
||||
const user = res.user;
|
||||
const avatar =
|
||||
user.icon == "" || user.icon == null
|
||||
? "../../src/assets/common/icons/logo.ico"
|
||||
? "/logo.ico"
|
||||
: import.meta.env.VITE_APP_BASEAPI + "/file/" + user.icon;
|
||||
if (res.roleCodes && res.roleCodes.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
|
||||
@@ -39,7 +39,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
},
|
||||
// 增加新的配置
|
||||
build: {
|
||||
assetsInlineLimit: 1,
|
||||
assetsInlineLimit: 0,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user