From 592720573d6b194bbac25b25b6c619376cb9c0a4 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期四, 13 十二月 2018 13:38:34 +0800
Subject: [PATCH] 修改电池查询面板中正则的验证
---
gx_tieta/src/com/fgkj/actions/ActionUtil.java | 62 +++++++++++++++++++++++++++++-
1 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/actions/ActionUtil.java b/gx_tieta/src/com/fgkj/actions/ActionUtil.java
index b9bface..edb0b51 100644
--- a/gx_tieta/src/com/fgkj/actions/ActionUtil.java
+++ b/gx_tieta/src/com/fgkj/actions/ActionUtil.java
@@ -1,5 +1,6 @@
package com.fgkj.actions;
+import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -34,6 +35,8 @@
public static String time_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
+
+ public String key; //璺ㄥ煙璇嗗埆鐮�
/*
* 鑾峰彇HttpServletRequest
@@ -246,9 +249,6 @@
return new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss").format(c.getTime());
}
- public static void main(String[] args) {
- System.out.println(ActionUtil.EncryptionMD5("vip"));
- }
//鑾峰彇鏃堕棿鐨勫勾浠�
public static int getDateYear(Date date){
@@ -475,4 +475,60 @@
return b;
}
+
+ /**
+ * 鍏佽璺ㄥ煙璇锋眰
+ */
+ public static void isAllowHeaders(){
+ HttpServletResponse res = getResponse();
+ res.setHeader("Access-Control-Allow-Origin", "*"); //鍏佽璺ㄥ煙璁块棶
+ res.setHeader("Access-Control-Allow-Headers", "X-Requested-With,content-type,token");
+ res.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
+ }
+
+
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ /**
+ * 鍒涘缓鎸囧畾鐨勬枃浠舵枃浠讹紝鑻ヤ笉瀛樺湪鍒欏厛鍒涘缓鎸囧畾鐨勬枃浠跺す鍐嶅垱寤烘寚瀹氱殑鏂囦欢
+ * @param filePath
+ */
+ public static void createFileRootIFNotExist(String filePath){
+ File f = new File(filePath);
+ if(!f.exists()){
+ if(!f.getParentFile().exists()){
+ f.getParentFile().mkdirs();
+ }
+ try {
+ f.createNewFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * 鍒涘缓鎸囧畾鐨勬枃浠舵枃浠讹紝鑻ヤ笉瀛樺湪鍒欏厛鍒涘缓鎸囧畾鐨勬枃浠跺す鍐嶅垱寤烘寚瀹氱殑鏂囦欢
+ * @param filePath
+ */
+ public static void createFilefolderIFNotExist(String filePath){
+ File f = new File(filePath);
+ if(!f.exists()){
+ if(!f.getParentFile().exists()){
+ f.getParentFile().mkdirs();
+ }
+ }
+ }
+
+
+ public static void main(String[] args) {
+ String str = "绂忓厜鐢靛瓙";
+ //System.out.println(EncryptionMD5(EncryptionMD5(str)));
+
+
+ createFilefolderIFNotExist("d:/aaaa/aaaa/aaaa/aaaa/ddd.txt");
+ }
}
--
Gitblit v1.9.1