he2802 4 rokov pred
rodič
commit
ca3daa84ce

+ 11 - 3
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ServletUtils.java

@@ -13,11 +13,19 @@ import java.io.IOException;
 
 /**
  * 客户端工具类
- * 
+ *
  * @author zhongzheng
  */
 public class ServletUtils
 {
+    /**
+     * 获取模块编码参数
+     */
+    public static String getEncoded(String tag)
+    {
+        String time = String.valueOf(System.currentTimeMillis()/1000);
+        return tag+time.substring(1)+(Math.random()*10);
+    }
     /**
      * 获取String参数
      */
@@ -82,7 +90,7 @@ public class ServletUtils
 
     /**
      * 将字符串渲染到客户端
-     * 
+     *
      * @param response 渲染对象
      * @param string 待渲染的字符串
      * @return null
@@ -105,7 +113,7 @@ public class ServletUtils
 
     /**
      * 是否是Ajax异步请求
-     * 
+     *
      * @param request
      */
     public static boolean isAjaxRequest(HttpServletRequest request)