Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
“v_kkhuang” committed Dec 11, 2024
1 parent 4c74cef commit c8fb934
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,14 +685,18 @@ public Message getUserKeyValue(
parms.put("nonce", SHAUtils.DOCTOR_NONCE);
// doctor提供的token
String token = SHAUtils.DOCTOR_TOKEN.getValue();
String signature =
SHAUtils.Encrypt(
SHAUtils.Encrypt(
parms.get("app_id") + SHAUtils.DOCTOR_NONCE + System.currentTimeMillis(), null)
+ token,
null);
parms.put("signature", signature);
return Message.ok().data("doctor", parms);
if (StringUtils.isNotBlank(token)){
String signature =
SHAUtils.Encrypt(
SHAUtils.Encrypt(
parms.get("app_id") + SHAUtils.DOCTOR_NONCE + System.currentTimeMillis(), null)
+ token,
null);
parms.put("signature", signature);
return Message.ok().data("doctor", parms);
} else {
return Message.error("Doctor token cannot be empty");
}
}

@ApiOperation(
Expand Down

0 comments on commit c8fb934

Please sign in to comment.