Vue.prototype.getYearMonthDayTime=function(
symbolExpressYear = "-",
symbolExpressMonth = "-",
symbolExpress = ":"
) {
let date = new Date();
let yearTime = date.getFullYear(); // 获取完整的年份(4位,1970)
let MonthTime =( date.getMonth() + 1)>9 ?( date.getMonth() + 1) : "0"+( date.getMonth() + 1); // 获取月份(0-11,0代表1月,用的时候记得加上1)
let dayTime = date.getDate()>9 ? date.getDate() :"0"+date.getDate(); // 获取日(01-31)
let HoverTIme = date.getHours()>9 ? (date.getHours()) :("0"+date.getHours()); // 获取小时数(0-23)
let MinyutesTime = date.getMinutes()>9 ? (date.getMinutes()) : ("0"+date.getMinutes()); // 获取分钟数(0-59)
let secondsTime = date.getSeconds()>9 ? (date.getSeconds()) :("0"+date.getSeconds()); // 获取秒(0-59)
return (
yearTime +
symbolExpressYear +
MonthTime +
symbolExpressMonth +
dayTime +
" " +
HoverTIme +
symbolExpress +
MinyutesTime +
symbolExpress +
secondsTime
);
},
getYearMonthDayTime()
可以传递参数
http://localhost:8081/#/home?VNK=0d6e095f&accesstoken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcGVuQWNjb3VudElkIjoiNDcwOTQ1MTYzMDUzNzY0NjA4IiwidGVuYW50SWQiOiIwIiwicGxhdGZvcm1UeXBlIjoicGMiLCJpZCI6IjQ1MDcyOTI2NDkzODA5NDYwNyIsIm9wZW5Vc2VySW5mb0lkIjoiNDcwOTQ1MTYzMDI4NTk4Nzg1IiwidXNlck5hbWUiOiIxODM4Mzg0MTUxMyIsImV4cCI6MTU5ODg1OTk2OCwib3JnSWQiOiI0NTA2OTc5MDY0Mjk3NTk2MTIiLCJ1c2VySW5mb0lkIjoiNDUwNzI5MjY0OTM4MDk0NjA2In0.j8Y0iZHRcbN_X7-hkqRimO9CwNzyTWlQu2kuCryl5QQ