Browse Source

[新增]绑定手机号

master
邵佳豪 7 days ago
parent
commit
52f1ca7317
  1. 9
      src/app/home/system-management/user/user.component.html
  2. 12
      src/app/home/system-management/user/user.component.ts

9
src/app/home/system-management/user/user.component.html

@ -69,9 +69,12 @@
{{item.creationTime | date:"yyyy-MM-dd"}}
</td>
<td>
<span *ngFor="let i of item.phone">
{{i}}
</span>
<div *ngIf="item.phone">
<span *ngFor="let i of item.phone">
{{i}}
</span>
</div>
</td>
<td>
<ng-container *ngIf="item.enabled; else elseTemplate">

12
src/app/home/system-management/user/user.component.ts

@ -86,18 +86,8 @@ export class UserComponent implements OnInit {
this.http
.get('/api/Users', {
params: params,
responseType: 'text',
})
.subscribe((res: any) => {
const key = '258e0ec35ea5c5d2479156be98e9b3e2';
function base64ToHex(base64: string): string {
const binary = atob(base64); // Base64 解码成二进制字符串
return Array.from(binary) // 转换成字节数组
.map((byte) => ('0' + byte.charCodeAt(0).toString(16)).slice(-2)) // 转16进制
.join('');
}
const publicKeyHex = base64ToHex(res);
const data = JSON.parse(sm4.decrypt(publicKeyHex, key) as any);
.subscribe((data: any) => {
this.isLoading = false;
this.userList = data.items;

Loading…
Cancel
Save