diff --git a/App.vue b/App.vue
index d562bc9..be62cf0 100644
--- a/App.vue
+++ b/App.vue
@@ -1,5 +1,4 @@
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 4505c5d..b9305d0 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -6,7 +6,7 @@
{{city}}
-
+
@@ -36,8 +36,8 @@
-
-
+
+
@@ -48,9 +48,14 @@
{{item.timeGo}}年
-
- {{item.iconTitle}}
-
+
+
+
+ {{items}}
+
+
+
+
{{item.num}}
@@ -73,7 +78,7 @@
+
+
\ No newline at end of file
diff --git a/store/getters.js b/store/getters.js
deleted file mode 100644
index b1c6ea4..0000000
--- a/store/getters.js
+++ /dev/null
@@ -1 +0,0 @@
-export default {}
diff --git a/store/index.js b/store/index.js
index 5e2e38c..6418fe6 100644
--- a/store/index.js
+++ b/store/index.js
@@ -2,7 +2,6 @@ import Vue from 'vue'
import Vuex from 'vuex'
import data from './modules/data'
import user from './modules/user'
-import getters from './getters'
Vue.use(Vuex)
@@ -11,8 +10,7 @@ const store = new Vuex.Store({
modules: {
data,
user
- },
- getters
+ }
})
export default store
\ No newline at end of file
diff --git a/store/modules/data.js b/store/modules/data.js
index ec29208..9b10a6e 100644
--- a/store/modules/data.js
+++ b/store/modules/data.js
@@ -2,18 +2,16 @@ import { getConfig } from "@/common/api.js"
export default {
state: {
- configList:[]
},
-
+ getters: {
+
+ },
mutations: {
- setUserInfo(state,obj){
- state.configList = obj
- },
+
// 初始化配置
- initConfig(){
+ initConfig(state){
getConfig({}).then(response=>{
- console.info(response)
- // that.commit('setUserInfo',{userInfo:response.result.userInfo,token:response.result.token})
+ uni.setStorageSync('configList', response.result)
}).catch(error=>{
})
diff --git a/util/request/requestInterceptors.js b/util/request/requestInterceptors.js
index 45299fe..984a442 100644
--- a/util/request/requestInterceptors.js
+++ b/util/request/requestInterceptors.js
@@ -9,7 +9,7 @@ export const requestInterceptors = (vm) => {
// 可以在此通过vm引用vuex中的变量,具体值在vm.$store.state中
// console.log(vm.$store.state);
config.header['X-Access-Token'] = uni.getStorageSync('token');
- config.header['Content-Type'] = 'application/json'
+ config.header['Content-Type'] = 'application/x-www-form-urlencoded'
return config
}, (config) => // 可使用async await 做异步操作
Promise.reject(config))
diff --git a/util/request/responseInterceptors.js b/util/request/responseInterceptors.js
index 90f0e88..1e7a947 100644
--- a/util/request/responseInterceptors.js
+++ b/util/request/responseInterceptors.js
@@ -5,13 +5,14 @@
export const responseInterceptors = (vm) => {
uni.$uv.http.interceptors.response.use((response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/
const data = response.data
- if (data.code !== 200) { // 服务端返回的状态码不等于200,则reject()
- uni.$uv.toast(data.message)
- return false;
- }
- console.info('interceptors.response---------',data)
+ if (data.code !== 200) { // 服务端返回的状态码不等于200,则reject()
+ uni.$uv.toast(data.message)
+ return Promise.reject(data)
+ }
return Promise.resolve(data);
}, (response) => { /* 对响应错误做点什么 (statusCode !== 200)*/
+
+ console.info('interceptors.response---------',data)
return Promise.reject(response)
})
}
\ No newline at end of file