|
|
@@ -22,7 +22,8 @@
|
|
|
<li class="list-group-item">
|
|
|
<svg-icon icon-class="phone" class="tubiao"/>手机号码
|
|
|
<!-- <div class="pull-right">{{ state.user.phonenumber }}</div> -->
|
|
|
- <div class="pull-right">{{ phoneNumber(state.user.phonenumber) }}</div>
|
|
|
+ <!-- <div class="pull-right">{{ state.user.phonenumber }}</div> -->
|
|
|
+ <div class="pull-right">{{ phoneNumber(showP) }}</div>
|
|
|
</li>
|
|
|
<!-- <li class="list-group-item">
|
|
|
<svg-icon icon-class="email" />用户邮箱
|
|
|
@@ -71,8 +72,10 @@ import userInfo from "./userInfo";
|
|
|
import resetPwd from "./resetPwd";
|
|
|
import { getUserProfile } from "@/api/system/user";
|
|
|
import { onMounted,toRaw } from "vue";
|
|
|
+import { encode, decode } from '@/utils/sm2util'
|
|
|
let height = ref(document.documentElement.clientHeight - 16 + "px;");
|
|
|
const activeTab = ref("userinfo");
|
|
|
+const showP = ref()
|
|
|
const state = reactive({
|
|
|
user: {},
|
|
|
roleGroup: {},
|
|
|
@@ -84,20 +87,36 @@ function getUser() {
|
|
|
state.user = response.data;
|
|
|
state.roleGroup = response.roleGroup;
|
|
|
state.postGroup = response.postGroup;
|
|
|
+ state.user.phonenumber = decode(state.user.phonenumber)
|
|
|
+ showP.value = phoneNumber(state.user.phonenumber)
|
|
|
+ // console.log('state.user',state.user);
|
|
|
});
|
|
|
};
|
|
|
const phoneNumber = (num)=>{
|
|
|
if(num){
|
|
|
// console.log('num',num);
|
|
|
- const str1 = num.substr(0,3)
|
|
|
+ num = num+''
|
|
|
+ const str1 = num.substr(0,3)
|
|
|
const str2 = num.substr(3,4)
|
|
|
const str3 = num.substr(7,4)
|
|
|
- // console.log(str1,str2,str3);
|
|
|
- return str1+'****'+str3
|
|
|
+ if(num.length<4){
|
|
|
+ return str1
|
|
|
+ }else if(num.length == 4){
|
|
|
+ return str1+'*'
|
|
|
+ }else if(num.length == 5){
|
|
|
+ return str1+'**'
|
|
|
+ }else if(num.length == 6){
|
|
|
+ return str1+'***'
|
|
|
+ }else if(num.length == 7){
|
|
|
+ return str1+'****'
|
|
|
+ }else{
|
|
|
+ return str1+'****'+str3
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
const chengeUser = (number)=>{
|
|
|
state.user.phonenumber = number
|
|
|
+ showP.value = phoneNumber(number)
|
|
|
}
|
|
|
getUser();
|
|
|
onMounted(() => {
|