diff --git a/vue.live.js b/fite.config.js
similarity index 90%
rename from vue.live.js
rename to fite.config.js
index 71336e3..f2d9e77 100644
--- a/vue.live.js
+++ b/fite.config.js
@@ -29,6 +29,7 @@ export default {
'vue-router': '//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js',
// 这个库被vue-router依赖, 可以注释掉vue-router代码中的 @vue/devtools-api 的引入
// 以达到减少不必须的体积的效果
- fetch: '//jscdn.ink/@bytedo/fetch/2.1.1/next.js'
+ fetch: '//jscdn.ink/@bytedo/fetch/latest/next.js',
+ '@bd/core': '//jscdn.ink/@bd/core/latest/index.js'
}
}
diff --git a/index.html b/index.html
index 5a0a518..a9ab5ae 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
{{title}}
-
+
diff --git a/package.json b/package.json
index e08360f..c74dc4d 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,6 @@
"build": "fite build"
},
"devDependencies": {
- "fite": "^0.3.3"
+ "fite": "^0.6.0"
}
}
diff --git a/src/app.vue b/src/app.vue
index 5768984..8927487 100644
--- a/src/app.vue
+++ b/src/app.vue
@@ -8,14 +8,29 @@
import Header from './components/header.vue'
import Footer from './components/footer.vue'
+import fetch from '@/lib/fetch.js'
+
export default {
components: { Header, Footer },
mounted() {
var user = localStorage.getItem('user')
+ var checked = sessionStorage.getItem('session_checked')
if (user) {
- this.$store.user = JSON.parse(user)
+ if (checked) {
+ return (this.$store.user = JSON.parse(user))
+ }
+ fetch('/login/check')
+ .then(r => {
+ localStorage.setItem('token', r.data.token)
+ sessionStorage.setItem('session_checked', 1)
+ this.$store.user = JSON.parse(user)
+ })
+ .catch(r => {
+ localStorage.removeItem('token')
+ localStorage.removeItem('user')
+ })
}
}
}
diff --git a/src/lib/fetch.js b/src/lib/fetch.js
index 3d63521..03dd34a 100644
--- a/src/lib/fetch.js
+++ b/src/lib/fetch.js
@@ -1,6 +1,6 @@
import fetch from 'fetch'
-fetch.BASE_URL = 'https://api.jscdn.ink'
+fetch.BASE_URL = '//api.jscdn.ink'
fetch.inject.request(function (conf) {
var token = localStorage.getItem('token')
diff --git a/src/main.js b/src/main.js
index 7c68002..5057482 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,11 +1,13 @@
import { createApp } from 'vue'
import '//jscdn.ink/es.shim/2.1.0/index.js'
-import '//jscdn.ink/@bytedo/wcui/1.0.12/form/input.js'
+import '//jscdn.ink/@bd/ui/latest/form/input.js'
+import '//jscdn.ink/@bd/ui/latest/form/button.js'
+import '//jscdn.ink/@bd/ui/latest/form/switch.js'
+import '//jscdn.ink/@bd/ui/latest/form/link.js'
+import '//jscdn.ink/@bd/ui/latest/layer/index.js'
+import '//jscdn.ink/@bd/ui/latest/pager/index.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/dropdown.js'
-import '//jscdn.ink/@bytedo/wcui/1.0.12/form/button.js'
-import '//jscdn.ink/@bytedo/wcui/1.0.12/form/link.js'
-import '//jscdn.ink/@bytedo/wcui/1.0.12/layer/index.js'
import App from './app.vue'
diff --git a/src/views/request.vue b/src/views/request.vue
index 088a4b4..a507733 100644
--- a/src/views/request.vue
+++ b/src/views/request.vue
@@ -55,7 +55,7 @@