这个是函数
//比较日期大小function CompareDate(d1){ return ((new Date(d1))) > (new Date());
}//校验身份Vue.prototype.checkValidity = function(type){ let result
API.validity(function (res) { if(res.code == 1){ if(type == "z"){
result = (CompareDate(res.data.zin_expiring)) console.log( "z",result) return result
} if(type == "s"){
result = (CompareDate(res.data.sync_expiring)) console.log( "s",result) return result
}
} else { console.log(res.msg);
}
},{
user_id: localStorage.getItem('user_id')
})
}//调用在另一个页面console.log( "调用的打印",this.checkValidity("z"))输出结果
慕慕森
相关分类