LiJun
2018-11-16 af57cd2f73a05174bc8df1247bf80cc024a0b603
gx_tieta/src/com/fgkj/actions/ActionUtil.java
@@ -33,6 +33,10 @@
public class ActionUtil extends ActionSupport{
   public static String time_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
   
   public String key;                                                      //跨域识别码
   /*
    * 获取HttpServletRequest
    */
@@ -244,9 +248,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){
@@ -473,4 +474,25 @@
       
       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;
   }
   public static void main(String[] args) {
       String str = "福光电子";
       System.out.println(EncryptionMD5(EncryptionMD5(str)));
   }
}