| | |
| | | import com.google.gson.JsonSyntaxException; |
| | | import com.whyc.pojo.UserInf; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.web.context.ContextLoader; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import sun.misc.BASE64Decoder; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Optional; |
| | | |
| | | import static jdk.nashorn.internal.objects.NativeNumber.toFixed; |
| | | |
| | | public class ActionUtil{ |
| | | |
| | | public static String time_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss"; |
| | | public static String time_yyyyMMdd = "yyyy-MM-dd"; |
| | | public static SimpleDateFormat sdfwithOutday=new SimpleDateFormat("yyyy_MM"); |
| | | public static SimpleDateFormat sdfwithOutday = new SimpleDateFormat("yyyy_MM"); |
| | | public static SimpleDateFormat sdfwithday = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | /* |
| | | * 获取HttpServletRequest |
| | |
| | | * @return |
| | | */ |
| | | public static boolean generateImage(String imgStr, String path) { |
| | | if (imgStr == null) |
| | | return false; |
| | | if (imgStr == null) { |
| | | return false; |
| | | } |
| | | BASE64Decoder decoder = new BASE64Decoder(); |
| | | try { |
| | | // 解密 |