unknown
1 year ago
19 changed files with 283 additions and 132 deletions
-
8common/js/mixins.js
-
25components/callPhone/callPhone.vue
-
5config/api.js
-
9config/request.js
-
46config/utils.js
-
2pages.json
-
2pages/carEntry/operaAppointment/comp/step2.vue
-
4pages/carEntry/operaAppointment/comp/step3.vue
-
24pages/carEntry/operaAppointment/comp/step4.vue
-
30pages/carEntry/operaAppointment/operaAppointment.vue
-
112pages/carEntry/simulateAppointment/comp/step1.vue
-
8pages/indexEntry/enroll/registInfo/registInfo.vue
-
20pages/indexEntry/findShcool/comp/schoolItem.vue
-
48pages/indexEntry/findShcool/findShcool.vue
-
31pages/indexEntry/findShcool/shcoolDetail/comp/tab3.vue
-
31pages/indexEntry/findShcool/shcoolDetail/shcoolDetail.vue
-
2pages/tabbar/index/index.vue
-
2pages/tabbar/learnCar/comp/subject1.vue
-
BINstatic/images/index/avatar.png
@ -1,13 +1,51 @@ |
|||
|
|||
export function checkToken (vm) { |
|||
export function checkToken(vm) { |
|||
let expiresTime = vm.$store.state.user.vuex_loginInfo.expiresTime |
|||
let nowTime = new Date() * 1 |
|||
console.log('超时了') |
|||
console.log(expiresTime) |
|||
if(nowTime>expiresTime*1) { |
|||
if (nowTime > expiresTime * 1) { |
|||
vm.$store.commit('goLogin') |
|||
// 如果小于20分钟就刷新一下token &&
|
|||
}else if((expiresTime*1 - nowTime) / 60000 < 10 ) { |
|||
} else if ((expiresTime * 1 - nowTime) / 60000 < 30) { |
|||
vm.$store.dispatch('refreshToken') |
|||
} |
|||
} |
|||
|
|||
function dateRangeFn(dateRange) { |
|||
let tmp = [] |
|||
let dateArr = [] |
|||
dateRange.forEach((date) => { |
|||
let dateStr = date.toISOString().split('T')[0] |
|||
let dd = dateStr.split('-')[2] |
|||
const daysOfWeek = ['日', '一', '二', '三', '四', '五', '六']; |
|||
const dayOfWeek = date.getDay(); |
|||
const weekName = daysOfWeek[dayOfWeek]; |
|||
console.log(dateStr) |
|||
console.log(weekName) |
|||
if (tmp.length == 0) { |
|||
dateArr.push(tmp) |
|||
} |
|||
let obj = { |
|||
week: weekName, |
|||
num: dd, |
|||
date: dateStr |
|||
} |
|||
tmp.push(obj) |
|||
if (tmp.length == 5) { |
|||
tmp = [] |
|||
} |
|||
}); |
|||
console.log(dateArr) |
|||
return dateArr |
|||
} |
|||
|
|||
export function getDates(startDate, endDate) { |
|||
const dates = []; |
|||
let currentDate = new Date(startDate); |
|||
|
|||
while (currentDate <= endDate) { |
|||
dates.push(new Date(currentDate)); |
|||
currentDate.setDate(currentDate.getDate() + 1); |
|||
} |
|||
return dateRangeFn(dates) |
|||
} |
After Width: 50 | Height: 50 | Size: 4.5 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue