Explorar el Código

修复移动端不能正确展示头像的问题

zuypeng hace 1 año
padre
commit
f89c4a1d1b
Se han modificado 3 ficheros con 4 adiciones y 7 borrados
  1. 0 3
      src/pages/index/index.vue
  2. 3 4
      src/pages/user/index.vue
  3. 1 0
      src/utils/auth.ts

+ 0 - 3
src/pages/index/index.vue

@@ -78,9 +78,6 @@ const change = () => {
 const initState = () => ({
   bannerList: [],
   swiperList: [
-    'https://cdn.uviewui.com/uview/swiper/swiper3.png',
-    'https://cdn.uviewui.com/uview/swiper/swiper2.png',
-    'https://cdn.uviewui.com/uview/swiper/swiper1.png'
   ],
   menuList: [
     {name: "photo", title: "洗车",icon:'/static/iconfont/default/fastwash.svg'},

+ 3 - 4
src/pages/user/index.vue

@@ -12,11 +12,10 @@
               style="width: 12orpx;height: 120rpx"/>
         </view>
         <view class="main flex-shrink">
-          <view
+          <image
               class="avatar"
-              :style="{
-              'background-image': `url('/static/iconfont/me.svg')`,
-            }"></view>
+              src='/static/iconfont/me.svg'>
+              </image>
           <view class="phone fs-40 fw-500">{{ user.mobilePhone }}</view>
 
           <view class="money" @click="toPage({path: '/pages-user/wallet/index'})">

+ 1 - 0
src/utils/auth.ts

@@ -151,6 +151,7 @@ export function loadUserInfo() {
     getApp<any>().globalData.manualLogout = false;
     get(`/user/me`).then((res: any) => {
         getApp<any>().globalData.user = res;
+        getApp<any>().globalData.isLogin = true;
         uni.$emit('login', {isLogin: true})
     })
 }