Explorar el Código

refactor:修改手机号后刷新用户信息

zhanghui hace 2 años
padre
commit
16c6dcb1fb
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      myPages/setting/setting-telphone.vue

+ 8 - 0
myPages/setting/setting-telphone.vue

@@ -124,6 +124,13 @@ export default {
 		this.$refs.form1.setRules(this.rules)
 	},
 	methods: {
+
+		getUserInfo(){
+			this.$api.getUserInfo().then(res=>{
+				uni.setStorageSync('userInfo',res.data.data)
+			})
+
+		},
 		// 验证电话号码是否存在
 		saveSetPhoneData(){
 			let that = this;
@@ -132,6 +139,7 @@ export default {
 				uni.showToast({
 					title: '绑定成功'
 				})
+				this.getUserInfo()
 				setTimeout(function() {
 				   // 绑定成功,返回我的页面
 				   uni.switchTab({