|
|
@ -20,7 +20,9 @@ const store = new Vuex.Store({ |
|
|
|
// 初始化配置
|
|
|
|
initConfig(state) { |
|
|
|
api('getConfig', res => { |
|
|
|
const configList = {}; |
|
|
|
const configList = { |
|
|
|
...state.configList, |
|
|
|
} |
|
|
|
if (res.code == 200) { |
|
|
|
res.result.forEach(n => { |
|
|
|
configList[n.keyName] = n.keyContent; |
|
|
@ -28,6 +30,7 @@ const store = new Vuex.Store({ |
|
|
|
}); |
|
|
|
} |
|
|
|
state.configList = configList |
|
|
|
uni.$emit('initConfig', state.configList) |
|
|
|
}) |
|
|
|
|
|
|
|
// let config = ['getPrivacyPolicy', 'getUserAgreement']
|
|
|
@ -39,7 +42,7 @@ const store = new Vuex.Store({ |
|
|
|
// })
|
|
|
|
// })
|
|
|
|
}, |
|
|
|
login(state, phoneCode) { |
|
|
|
login(state, config) { |
|
|
|
uni.showLoading({ |
|
|
|
title: '登录中...' |
|
|
|
}) |
|
|
@ -51,7 +54,6 @@ const store = new Vuex.Store({ |
|
|
|
|
|
|
|
let data = { |
|
|
|
code: res.code, |
|
|
|
phoneCode, |
|
|
|
} |
|
|
|
|
|
|
|
if (uni.getStorageSync('shareId')) { |
|
|
@ -118,7 +120,7 @@ const store = new Vuex.Store({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 退出登录
|
|
|
|
logout(state) { |
|
|
|
logout(state, reLaunch = false) { |
|
|
|
// uni.showModal({
|
|
|
|
// title: '确认退出登录吗',
|
|
|
|
// success(r) {
|
|
|
@ -131,10 +133,23 @@ const store = new Vuex.Store({ |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
|
|
|
|
state.userInfo = {} |
|
|
|
uni.removeStorageSync('token') |
|
|
|
uni.reLaunch({ |
|
|
|
url: '/pages/index/index' |
|
|
|
|
|
|
|
if(reLaunch){ |
|
|
|
uni.reLaunch({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
getQrCode(state) { |
|
|
|
api('getInviteCode', res => { |
|
|
|
if (res.code == 200) { |
|
|
|
state.promotionUrl = Vue.prototype.$config.aliOss.url + res.result.url |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询分类接口
|
|
|
|