|
@ -23,6 +23,16 @@ export default { |
|
|
this.$store.commit('user/setToken', token); |
|
|
this.$store.commit('user/setToken', token); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询广告页和引导页并缓存 |
|
|
|
|
|
this.getGuide(0); |
|
|
|
|
|
this.getGuide(1); |
|
|
|
|
|
|
|
|
|
|
|
// 定时查询服务和插件 |
|
|
|
|
|
setInterval(() => { |
|
|
|
|
|
this.getServices(); |
|
|
|
|
|
this.getPlugins(); |
|
|
|
|
|
}, 60000); |
|
|
|
|
|
|
|
|
// if (!token) { |
|
|
// if (!token) { |
|
|
// this.$ui.showToast('获取用户信息失败, 请登录'); |
|
|
// this.$ui.showToast('获取用户信息失败, 请登录'); |
|
|
// // TODO: 跳转登录界面 |
|
|
// // TODO: 跳转登录界面 |
|
@ -41,6 +51,31 @@ export default { |
|
|
// const path = this.theme.replace('-', '/'); |
|
|
// const path = this.theme.replace('-', '/'); |
|
|
// import(`./common/styles/${path}.scss`); |
|
|
// import(`./common/styles/${path}.scss`); |
|
|
// }, |
|
|
// }, |
|
|
|
|
|
/** |
|
|
|
|
|
* 查询广告页和引导页并缓存 |
|
|
|
|
|
*/ |
|
|
|
|
|
async getGuide(type) { |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await uni.$u.api.getGuide(type); |
|
|
|
|
|
type === 0 ? uni.$storage.setStorageSync('guide', res) : uni.$storage.setStorageSync('advs', res); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
throw error; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询服务 |
|
|
|
|
|
*/ |
|
|
|
|
|
async getServices() { |
|
|
|
|
|
console.log('服务') |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询插件 |
|
|
|
|
|
*/ |
|
|
|
|
|
async getPlugins() { |
|
|
|
|
|
console.log('插件') |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
async getToken() { |
|
|
async getToken() { |
|
|
const { token } = this.$store.state.user; |
|
|
const { token } = this.$store.state.user; |
|
|