You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
package com.fanruan.api.decision; |
|
|
|
import com.fanruan.api.log.LogKit; |
|
import com.fanruan.api.util.StringKit; |
|
import com.fr.base.Base64; |
|
import com.fr.base.ServerConfig; |
|
import com.fr.decision.webservice.utils.DecisionServiceConstants; |
|
import com.fr.stable.StringUtils; |
|
|
|
/** |
|
* @author richie |
|
* @version 10.0 |
|
* Created by richie on 2019-09-19 |
|
* 常规工具类 |
|
*/ |
|
public class CommonKit { |
|
|
|
/** |
|
* 这个方法用于判断从前端返回服务器端的密码是否有被修改过 |
|
* |
|
* @param password 从前端返回的密码文本 |
|
* @return 如果密码没有被修改过就返回true,否则就返回false |
|
*/ |
|
public static boolean isDefaultPasswordHolderString(String password) { |
|
return DecisionServiceConstants.DEFAULT_PASSWORD.equals(password); |
|
} |
|
|
|
/** |
|
* 获取默认密码占位符 |
|
* |
|
* @return 默认密码占位符 |
|
*/ |
|
public static String fetchDefaultPasswordHolderString() { |
|
return DecisionServiceConstants.DEFAULT_PASSWORD; |
|
} |
|
|
|
/** |
|
* 将base64编码的字符串转为常规的字符串 |
|
* |
|
* @param encodeStr base64编码的字符串 |
|
* @return 常规字符串 |
|
*/ |
|
public static String getBase64DecodeStr(String encodeStr) { |
|
try { |
|
if (StringUtils.isNotEmpty(encodeStr)) { |
|
return new String(Base64.decode(encodeStr), ServerConfig.getInstance().getServerCharset()); |
|
} |
|
} catch (Exception e) { |
|
LogKit.error(e.getMessage(), e); |
|
} |
|
|
|
return StringKit.EMPTY; |
|
} |
|
}
|
|
|