diff --git a/src/App.vue b/src/App.vue
index adc5459..35cb75a 100755
--- a/src/App.vue
+++ b/src/App.vue
@@ -13,6 +13,7 @@
diff --git a/src/helpers/index.js b/src/helpers/index.js
index 4d267fc..8b662f1 100644
--- a/src/helpers/index.js
+++ b/src/helpers/index.js
@@ -7,10 +7,11 @@ const isJSON = json => {
if (json && typeof json === 'object' && json !== null) {
return true
}
- } catch (err) {}
- return false
+ } catch (error) {
+ return error
+ }
}
-export default {
+export {
isJSON
}
diff --git a/src/router.js b/src/router.js
index 2b251ae..9be62dd 100755
--- a/src/router.js
+++ b/src/router.js
@@ -4,20 +4,9 @@ import Home from '@/views/Home'
import Splash from '@/views/Splash'
import About from '@/views/About'
import Store from '@/views/Store'
-import user from '@/user'
Vue.use(Router)
-const requireUser = (to, from, next) => {
- if (!user.checkUserGeoData()) {
- next({
- path: '/'
- })
- } else {
- next()
- }
-}
-
export default new Router({
scrollBehavior () {
return new Promise(resolve => {
@@ -41,8 +30,7 @@ export default new Router({
{
path: '/home',
name: 'home',
- component: Home,
- beforeEnter: requireUser
+ component: Home
},
{
path: '/store/:id',
diff --git a/src/store.js b/src/store.js
index b9fe184..2cf8832 100755
--- a/src/store.js
+++ b/src/store.js
@@ -1,6 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
-import user from '@/user'
+import { getUserData } from '@/user'
Vue.use(Vuex)
@@ -16,8 +16,8 @@ export default new Vuex.Store({
setLoading (state, value) {
state.loading = value
},
- async setUserGeoData (state, { force }) {
- const data = await user.getUserData(force)
+ async setUserGeoData (state, { force = false }) {
+ const data = await getUserData(force)
state.userData = data
},
setMenu (state, value) {
diff --git a/src/user.js b/src/user.js
index b893757..9947611 100755
--- a/src/user.js
+++ b/src/user.js
@@ -1,27 +1,63 @@
-import helpers from '@/helpers'
+import { isJSON } from '@/helpers'
/**
* Get user geo from device
* @return {Promise