| @@ -91,7 +91,7 @@ public class HashUtil { | |||||
| } | } | ||||
| try { | try { | ||||
| String enc = hash("md5", str); | String enc = hash("md5", str); | ||||
| enc = new String(Base64.getUrlEncoder().encode(enc.getBytes("utf-8"))); | |||||
| enc = new String(Base64.getUrlEncoder().encode(enc.getBytes("utf-8")), "utf-8"); | |||||
| return enc; | return enc; | ||||
| } catch (UnsupportedEncodingException e) { | } catch (UnsupportedEncodingException e) { | ||||
| return null; | return null; | ||||
| @@ -102,7 +102,13 @@ public class HashUtil { | |||||
| if (str == null) { | if (str == null) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| String dec = new String(Base64.getUrlDecoder().decode(str)); | |||||
| return dec; | |||||
| try { | |||||
| String dec = new String(Base64.getUrlDecoder().decode(str), "utf-8"); | |||||
| return dec; | |||||
| } catch (Exception e) { | |||||
| System.out.println(str); | |||||
| System.out.println(e.getMessage()); | |||||
| return null; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||