mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-10 03:16:47 +08:00
-- 用户头像
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user