Browse Source

王国宇修改

tanxue 2 months ago
parent
commit
f01b9271ba
1 changed files with 15 additions and 2 deletions
  1. 15 2
      pages/my/headImg.vue

+ 15 - 2
pages/my/headImg.vue

@@ -20,7 +20,7 @@
 	import cacheManager from '@/utils/cacheManager.js';
 	import {
 		getFilePolicy,
-		updataHead
+		updataHead,myInfo
 	} from '@/api/my.js'
 	import {
 		onLoad
@@ -156,7 +156,20 @@
 			return currentPlatform.value = 'android'
 		}
 	}
+	function getMyInfo() {
+			myInfo({}).then(res => {
+				if (res.code == 0) {
+					userImg.value = res.data.icon;
+				} else {
+					toast('获取头像失败')
+					return false
+				}
+	
+			})
+		}
+			
 	onLoad((options) => {
-		isIOSorAndroid()
+		isIOSorAndroid();
+		getMyInfo();
 	})
 </script>