From 7842d6c9253037364a15cf2397d3d64003db95fc Mon Sep 17 00:00:00 2001 From: chenjiahe <763432473@qq.com> Date: 星期五, 22 十月 2021 18:51:24 +0800 Subject: [PATCH] 优化修改 --- src/main/java/com/platform/verification/VerificationTool.java | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/platform/verification/VerificationTool.java b/src/main/java/com/platform/verification/VerificationTool.java index 5056c69..e9b48c5 100644 --- a/src/main/java/com/platform/verification/VerificationTool.java +++ b/src/main/java/com/platform/verification/VerificationTool.java @@ -26,15 +26,15 @@ public static PlatformResult verification(String appId,String sign,String sys_appId,String sys_private_key){ if (StringUtils.isEmpty(sign)) { - return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒"); + return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒01"); } if (StringUtils.isEmpty(appId)) { - return PlatformResult.failure(PlatformCode.ERROR_APPIS, "APPID閿欒"); + return PlatformResult.failure(PlatformCode.ERROR_APPIS, "APPID閿欒01"); } //鏍¢獙appid鏄惁瀛樺湪 - if(!sys_appId.equals("appId")){ - return PlatformResult.failure(PlatformCode.ERROR_APPIS, "APPID閿欒"); + if(!sys_appId.equals(appId)){ + return PlatformResult.failure(PlatformCode.ERROR_APPIS, "APPID閿欒02"); } //瑙e瘑RSA @@ -45,28 +45,27 @@ } if(StringUtils.isEmpty(decrypt)){ - return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒"); + return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒02"); } //decrypt鏍煎紡锛歛ppId_鏃堕棿鎴砡闅忔満鏁帮紙灏介噺灏戯級 String[] decrypts = decrypt.split("_"); if(decrypts.length != 3){ - return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒"); + return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒03"); } if (!appId.equals(decrypts[0])) { - return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒"); + return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒04"); } Date date = null; try{ - //鍒ゆ柇鎺ュ彛鏃堕棿 SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String sd = sdf.format(new Date(Long.parseLong(String.valueOf(decrypts[1])))); // 鏃堕棿鎴宠浆鎹㈡垚鏃堕棿 date = DateUtil.parseString(sd,"yyyy-MM-dd HH:mm:ss"); }catch (Exception e){ - return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒"); + return PlatformResult.failure(PlatformCode.ERROR_SIGN, "绛惧悕閿欒05"); } //鎺ュ彛鏈夋晥2绉掗挓 -- Gitblit v1.8.0