瀏覽代碼

Merge branch 'master' into developer

yuwenjun1997 2 年之前
父節點
當前提交
f22f8d08ea
共有 2 個文件被更改,包括 8 次插入3 次删除
  1. 4 2
      src/layout/components/AvatarWrapper/index.vue
  2. 4 1
      src/layout/components/UserCard/index.vue

+ 4 - 2
src/layout/components/AvatarWrapper/index.vue

@@ -38,9 +38,11 @@ export default {
     isSupplier() {
       return this.userIdentity === 2
     },
+    mobileWidthStar() {
+      return this.mobile ? this.mobile.replace(/^(\w{3})\w+(\w{4})$/, '$1****$2') : ''
+    },
     userName() {
-      console.log(this.mobile, this.loginAccount, this.name)
-      return this.loginAccount || this.mobile || this.name
+      return this.loginAccount || this.mobileWidthStar || this.name
     },
     // 未开通会员
     notOpen() {

+ 4 - 1
src/layout/components/UserCard/index.vue

@@ -30,8 +30,11 @@ export default {
   },
   computed: {
     ...mapGetters(['name', 'mobile', 'loginAccount', 'vipInfo']),
+    mobileWidthStar() {
+      return this.mobile ? this.mobile.replace(/^(\w{3})\w+(\w{4})$/, '$1****$2') : ''
+    },
     userName() {
-      return this.loginAccount || this.mobile || this.name
+      return this.loginAccount || this.mobileWidthStar || this.name
     },
     // 未开通会员
     notOpen() {