import Cookies from 'js-cookie'
|
|
const TokenKey = 'Admin-Token'
|
|
export function computePageCount(totalCount, pageSize) {
|
if (pageSize == 0) {
|
return 0
|
}
|
return totalCount % pageSize == 0
|
? totalCount / pageSize
|
: totalCount / pageSize + 1
|
}
|
|
export function formatDateDay(value) {
|
let date = new Date(value);
|
let y = date.getFullYear();
|
let MM = date.getMonth() + 1;
|
MM = MM < 10 ? "0" + MM : MM;
|
let d = date.getDate();
|
d = d < 10 ? "0" + d : d;
|
let h = date.getHours();
|
return y + "年" + MM + "月" + d + "日";
|
}
|