This commit is contained in:
xiaojunnuo
2025-01-15 23:13:17 +08:00
parent 87620b9072
commit 93b37a89c9
2 changed files with 14 additions and 6 deletions
@@ -71,7 +71,7 @@ export class OpenKeyService extends BaseService<OpenKeyEntity> {
} else {
throw new CodeException(Constants.res.openKeySignTypeError);
}
if (computedSign !== sign) {
if (Buffer.from(computedSign).toString('base64') !== sign) {
throw new CodeException(Constants.res.openKeySignError);
}
@@ -101,6 +101,6 @@ export class OpenKeyService extends BaseService<OpenKeyEntity> {
};
const content = JSON.stringify(openKey);
const sign = utils.hash.md5(content + keySecret);
return Buffer.from(content).toString('base64') + '.' + sign;
return Buffer.from(content).toString('base64') + '.' + Buffer.from(sign).toString('base64');
}
}