You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/**
|
|
|
|
* 公共的JS类
|
|
|
|
* @author dexiang.jiang
|
|
|
|
* @date 2019/04/18 11:15
|
|
|
|
* @company kiisoo
|
|
|
|
*/
|
|
|
|
|
|
|
|
import roter from '../router'
|
|
|
|
// import store from '../store'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 跳转到登录页面
|
|
|
|
* @author dexiang.jiang
|
|
|
|
* @date 2019/04/18 11:19
|
|
|
|
*/
|
|
|
|
export function goToLogin() {
|
|
|
|
// store.commit("LOGOUT");
|
|
|
|
roter.push('/login')
|
|
|
|
}
|
|
|
|
|
|
|
|
export function formatDate(dt) {
|
|
|
|
dt = new Date(dt)
|
|
|
|
let year = dt.getFullYear()
|
|
|
|
let month = dt.getMonth() + 1
|
|
|
|
let day = dt.getDate()
|
|
|
|
month = month < 10 ? '0' + month : month
|
|
|
|
day = day < 10 ? '0' + day : day
|
|
|
|
return year + '-' + month + '-' + day
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
goToLogin,
|
|
|
|
formatDate,
|
|
|
|
}
|