fix:修复文章头像显示的bug
This commit is contained in:
@@ -43,6 +43,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import useUserStore from "@/stores/user";
|
import useUserStore from "@/stores/user";
|
||||||
import { reactive, watch, onMounted, computed, ref } from "vue";
|
import { reactive, watch, onMounted, computed, ref } from "vue";
|
||||||
|
import { upload } from "@/apis/fileApi";
|
||||||
|
|
||||||
//userInfo
|
//userInfo
|
||||||
//{icon,name,role,id},根据判断userInfo是否等于未定义,来觉得是当前登录用户信息,还是其他人信息
|
//{icon,name,role,id},根据判断userInfo是否等于未定义,来觉得是当前登录用户信息,还是其他人信息
|
||||||
const props = defineProps([
|
const props = defineProps([
|
||||||
@@ -62,15 +64,16 @@ const userInfo = reactive({
|
|||||||
userLimit: "",
|
userLimit: "",
|
||||||
});
|
});
|
||||||
const iconUrl = ref("/favicon.ico");
|
const iconUrl = ref("/favicon.ico");
|
||||||
const iconUrlHandler = () => {
|
const iconUrlHandler = (icon) => {
|
||||||
if (
|
if (
|
||||||
userInfo.icon == null ||
|
userInfo.icon == null ||
|
||||||
userInfo.icon == undefined ||
|
userInfo.icon == undefined ||
|
||||||
userInfo.icon == ""
|
userInfo.icon == ""
|
||||||
) {
|
) {
|
||||||
return "/favicon.ico";
|
return "/favicon.ico";
|
||||||
|
} else {
|
||||||
|
return import.meta.env.VITE_APP_BASEAPI + "/file/" + icon;
|
||||||
}
|
}
|
||||||
return `/favicon.ico`;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(userStore, (n) => {
|
watch(userStore, (n) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user