wangJJ 5 سال پیش
والد
کامیت
fa81cda2a9
2فایلهای تغییر یافته به همراه7 افزوده شده و 6 حذف شده
  1. 1 1
      src/App.vue
  2. 6 5
      src/pages/UserCenter/Mine.vue

+ 1 - 1
src/App.vue

@@ -71,7 +71,7 @@ export default {
   },
   computed:{
     showSlice(){
-      if(this.$route.path==='/home')
+      if(this.$route.path==='/home' || this.$route.path==='/')
         return  true;
     }
   },

+ 6 - 5
src/pages/UserCenter/Mine.vue

@@ -41,8 +41,8 @@
           <provincecity v-if="userForm.location!==null"
             ref="addFormProvince"
             @selectChange="locationChange"
-            :provinceCode="userForm.location!==null?userForm.location.provinceCode:'3200'"
-            :cityCode="userForm.location!==null?userForm.location.cityCode:'3201'"
+            :provinceCode="userForm.location!==null?userForm.location&&userForm.location.provinceCode:'3200'"
+            :cityCode="userForm.location!==null?userForm.location&&userForm.location.cityCode:'3201'"
           ></provincecity>
 <!--          :isModifyMode="!isModifyMode"-->
         </el-form-item>
@@ -127,7 +127,8 @@
             console.log(params);
             Http.put(`/api/personal/update/${this.user.id}`, params).then(res => {
               this.isModifyMode = false;
-              notify('success', '修改成功 ')
+              notify('success', '修改成功 ');
+              this.loadData();
             })
           }
         })
@@ -188,8 +189,8 @@
           this.userForm.city = res.userVO.city ? res.userVO.city : '';
           this.userForm.personalCompetence = res.userVO.personalCompetence ? res.userVO.personalCompetence : [];
           this.userForm.location = getProvinceCodeByProvinceName(this.userForm.province, this.userForm.city);
-          this.userForm.province = this.location&&this.location.provinceCode;
-          this.userForm.city = this.location&&this.location.cityCode;
+          this.userForm.province = this.userForm.location&&this.userForm.location.provinceCode;
+          this.userForm.city = this.userForm.location&&this.userForm.location.cityCode;
         })
       },
       setUserInfo(){