This commit is contained in:
saplf
2019-09-08 23:35:10 +08:00
parent 7fae21f7ca
commit 51fdb7cc24
6 changed files with 20 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ import BigNumber from 'bignumber.js';
import _ from 'lodash';
import md5 from 'md5';
import { AreaCode, Estate } from '@/types/common';
import moment, { Moment } from 'moment';
export function encodePhone(code: AreaCode, phone: string): string {
if (code && code.areacode) return `+${code.areacode}-${phone || ''}`;
@@ -50,3 +51,7 @@ export function encryptPwd(pwd: string): string {
export function displayPhone(phone: string): string {
return `1******${_.takeRight(phone, 4).join('')}`;
}
export function displayTime(time: string | Moment): string {
return moment(time).format('YYYY-MM-DD HH:mm');
}