Merge branch 'dev' into hotfix

This commit is contained in:
李佳航
2025-01-22 23:12:47 +08:00
committed by GitHub
40 changed files with 1637 additions and 1105 deletions

View File

@@ -129,6 +129,21 @@ export function formatDuration(start: number, end?: number): string {
return result;
}
/**
* 转为匿名数字 number | undefined
*/
export function toAnonymousNumber(value: string | undefined): number {
if (value === undefined || value === null) {
return value as unknown as number;
}
const num = Number.parseInt(value);
if (Number.isNaN(num)) {
return undefined as unknown as number;
} else {
return num;
}
}
/**
* 格式化数字为 ,分割
*/

View File

@@ -12,7 +12,7 @@ export const encrypt = async (data: string | undefined): Promise<string | undefi
return data;
}
// 获取公钥
const publicKey = (await useCacheStore().loadSystemSetting()).encrypt?.publicKey;
const publicKey = (await useCacheStore().loadSystemSetting()).encrypt_publicKey;
const encryptor = new JSEncrypt();
encryptor.setPublicKey(publicKey);