|
|
@ -11,7 +11,11 @@ const store = new Vuex.Store({ |
|
|
|
configList: {}, //配置对象
|
|
|
|
userInfo : {}, |
|
|
|
}, |
|
|
|
getters: {}, |
|
|
|
getters: { |
|
|
|
getConfig(state){ |
|
|
|
return state.configList |
|
|
|
} |
|
|
|
}, |
|
|
|
mutations: { |
|
|
|
// 初始化配置
|
|
|
|
initConfig(state) { |
|
|
@ -25,6 +29,14 @@ const store = new Vuex.Store({ |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
let apiConfig = [ 'getPrivacyPolicy' , 'getUserAgreement' ] //需要访问不同接口才能得到的配置数据
|
|
|
|
let key = ['privacyAgreement','userAgreement'] |
|
|
|
apiConfig.forEach((item,index) => { |
|
|
|
api(item,res => { |
|
|
|
state.configList[key[index]] = res.result |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
login(state) { |
|
|
|
uni.login({ |
|
|
@ -46,7 +58,12 @@ const store = new Vuex.Store({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/login/wxUserInfo' |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/contentDetail/contentDetail' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
fail(err) { |
|
|
|