|
|
|
@ -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; |
|
|
|
|