فهرست منبع

默认两小时过期

zhengnaiwen_citu 1 سال پیش
والد
کامیت
7163b48e53
2فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 2 2
      src/hooks/web/useDictionaries.js
  2. 7 0
      src/router/modules/remaining.js

+ 2 - 2
src/hooks/web/useDictionaries.js

@@ -5,10 +5,10 @@ const DICT_CITY_API = {
   menduner_exp_type: getDictData
 }
 
-const setDict = (type, val, cacheTime) => {
+const setDict = (type, val, cacheTime = 7200) => {
   localStorage.setItem(type, JSON.stringify({
     data: val,
-    expire: Date.now() + cacheTime
+    expire: Date.now() + cacheTime * 1000
   }))
 }
 

+ 7 - 0
src/router/modules/remaining.js

@@ -40,6 +40,13 @@ const remainingRouter = [
     path: '',
     component: Layout,
     children: [
+      {
+        path: '',
+        component: () => import('@/views/Home/index'),
+        meta: {
+          title: '首页'
+        }
+      },
       {
         path: '/home',
         component: () => import('@/views/Home/index'),