Browse Source

个人中心

aleyds 11 months ago
parent
commit
44f4d47711

+ 2 - 2
src/views/system/user/profile/index.vue

@@ -13,11 +13,11 @@
             <ul class="list-group list-group-striped">
               <li class="list-group-item">
                 <svg-icon icon-class="user" />用户名称
-                <div class="pull-right">{{ user.userName }}</div>
+                <div class="pull-right">{{ user.name }}</div>
               </li>
               <li class="list-group-item">
                 <svg-icon icon-class="phone" />手机号码
-                <div class="pull-right">{{ user.phonenumber }}</div>
+                <div class="pull-right">{{ user.mobile }}</div>
               </li>
               <li class="list-group-item">
                 <svg-icon icon-class="email" />用户邮箱

+ 6 - 6
src/views/system/user/profile/userInfo.vue

@@ -2,9 +2,9 @@
   <el-form ref="form" :model="form" :rules="rules" label-width="80px">
     <el-form-item label="用户昵称" prop="nickName">
       <el-input v-model="form.nickName" maxlength="30" />
-    </el-form-item> 
-    <el-form-item label="手机号码" prop="phonenumber">
-      <el-input v-model="form.phonenumber" maxlength="11" />
+    </el-form-item>
+    <el-form-item label="手机号码" prop="mobile">
+      <el-input v-model="form.mobile" maxlength="11" />
     </el-form-item>
     <el-form-item label="邮箱" prop="email">
       <el-input v-model="form.email" maxlength="50" />
@@ -47,7 +47,7 @@ export default {
             trigger: ["blur", "change"]
           }
         ],
-        phonenumber: [
+        mobile: [
           { required: true, message: "手机号码不能为空", trigger: "blur" },
           {
             pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
@@ -62,7 +62,7 @@ export default {
     user: {
       handler(user) {
         if (user) {
-          this.form = { nickName: user.nickName, phonenumber: user.phonenumber, email: user.email, sex: user.sex };
+          this.form = { id:user.id, nickName: user.nickName, mobile: user.mobile, email: user.email, sex: user.sex };
         }
       },
       immediate: true
@@ -74,7 +74,7 @@ export default {
         if (valid) {
           updateUserProfile(this.form).then(response => {
             this.$modal.msgSuccess("修改成功");
-            this.user.phonenumber = this.form.phonenumber;
+            this.user.mobile = this.form.mobile;
             this.user.email = this.form.email;
           });
         }