Browse Source

Merge branch 'master' into developer

yuwenjun1997 2 years ago
parent
commit
f22f8d08ea

+ 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() {