mirror of
https://github.com/PlayEdu/backend
synced 2026-03-10 11:40:04 +08:00
时间转换moment公用函数
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import moment from "moment";
|
||||
|
||||
export function getToken(): string {
|
||||
return window.localStorage.getItem("playedu-backend-token") || "";
|
||||
}
|
||||
@@ -7,5 +9,9 @@ export function setToken(token: string) {
|
||||
}
|
||||
|
||||
export function clearToken() {
|
||||
window.localStorage.removeItem("playedu-backend-token");
|
||||
}
|
||||
window.localStorage.removeItem("playedu-backend-token");
|
||||
}
|
||||
|
||||
export function dateFormat(dateStr: string) {
|
||||
return moment(dateStr).format("YYYY-MM-DD HH:mm");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user