-- 用户头像

This commit is contained in:
yuping
2022-12-22 13:03:17 +08:00
parent 4ca82e4333
commit 1b55af84e3
4 changed files with 11 additions and 9 deletions

View File

@@ -32,16 +32,17 @@
</router-link>
</div> -->
<main style="z-index: 2">
<router-view />
<router-view/>
</main>
</div>
</template>
<script setup>
import { boeRequest } from "@/api/request";
import { GET_USER_INFO } from "@/api/ThirdApi";
import { useStore } from "vuex";
import { onMounted } from "vue";
import {boeRequest} from "@/api/request";
import {GET_USER_INFO} from "@/api/ThirdApi";
import {useStore} from "vuex";
import {onMounted} from "vue";
import router from "@/router";
console.log("版本0.9.3------------");
const store = useStore();
onMounted(() => {
@@ -50,6 +51,7 @@ onMounted(() => {
function getUserInfo() {
boeRequest(GET_USER_INFO).then((res) => {
res.result.avatar = import.meta.env.VITE_BOE_API_URL + '/upload' + (res.result.avatar ? res.result.avatar : '/800e23f7-b58c-4192-820d-0c6a2b7544cc.png')
store.commit("SET_USER", res.result);
});
}
@@ -59,7 +61,7 @@ function getUserInfo() {
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
// sans-serif;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
Microsoft YaHei, Arial, sans-serif;
Microsoft YaHei, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;

View File

@@ -21,7 +21,7 @@ export function useUserInfo(id) {
watch(id, () => {
id.value && boeRequest(GET_USER_LIST, {id: id.value}).then(res => {
userInfo.value = res.result.userInfoList[0]
userInfo.value.avatar = `/upload${userInfo.value.avatar}`
userInfo.value.avatar = `${import.meta.env.VITE_BOE_API_URL}/upload${userInfo.value.avatar?userInfo.value.avatar:'/800e23f7-b58c-4192-820d-0c6a2b7544cc.png'}`
})
})
return userInfo

View File

@@ -143,7 +143,7 @@
</div>
<!-- todo #路径详情 个人信息缺少img和介绍-->
<div class="teacheritem" :style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }">
<img class="peopleimg" :src="`/upload${userInfo.avatar}`" />
<img class="peopleimg" :src="userInfo.avatar" />
<div style="margin-left: 17px">
<div class="teacherName">
<div style="margin-right: 5px">

View File

@@ -191,7 +191,7 @@
class="teacheritem"
:style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }"
>
<img class="peopleimg" :src="`/upload${userInfo.avatar}`"/>
<img class="peopleimg" :src="userInfo.avatar"/>
<div style="margin-left: 17px">
<div class="teacherName">
<div style="margin-right: 5px">