|
|
@ -1,6 +1,21 @@ |
|
|
|
<script> |
|
|
|
// import { mapState } from 'vuex'; |
|
|
|
|
|
|
|
export default { |
|
|
|
// computed: { |
|
|
|
// ...mapState(['theme']), |
|
|
|
// }, |
|
|
|
|
|
|
|
// watch: { |
|
|
|
// theme(newTheme) { |
|
|
|
// console.log('newTheme: ', newTheme); |
|
|
|
// if (!newTheme) return; |
|
|
|
// this.loadTheme(); |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
|
|
|
|
async onLaunch(options) { |
|
|
|
// this.loadTheme(); |
|
|
|
console.log('onLaunch options: ', options); |
|
|
|
this.checkNetwork(); // 监听网络状态 |
|
|
|
this.getSystemInfo(); // 获取系统设备信息、 |
|
|
@ -16,6 +31,11 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// loadTheme() { |
|
|
|
// const path = this.theme.replace('-', '/'); |
|
|
|
// import(`./common/styles/${path}.scss`); |
|
|
|
// }, |
|
|
|
|
|
|
|
async getToken() { |
|
|
|
const { token } = this.$store.state.user; |
|
|
|
const tokenIsAvailable = this.$store.getters['user/tokenIsAvailable']; |
|
|
@ -63,18 +83,19 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (this.$store.state.user.token && localToken) { // 同步token |
|
|
|
if (this.$store.state.user.token && localToken) { |
|
|
|
// 同步token |
|
|
|
this.$store.commit('user/setToken', localToken); |
|
|
|
} |
|
|
|
if (this.$store.state.user.tokenExpiredTime && tokenExpiredTime) { // 同步tokenExpiredTime |
|
|
|
if (this.$store.state.user.tokenExpiredTime && tokenExpiredTime) { |
|
|
|
// 同步tokenExpiredTime |
|
|
|
this.$store.commit('user/setTokenExpiredTime', +tokenExpiredTime); |
|
|
|
} |
|
|
|
resolve(); |
|
|
|
} catch (error) { |
|
|
|
reject(error); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 检查网络状态 设置store里的网络状态变量 |
|
|
@ -136,10 +157,11 @@ export default { |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
/*每个页面公共css */ |
|
|
|
@import "@/uni_modules/vk-uview-ui/index.scss"; |
|
|
|
@import '@/uni_modules/vk-uview-ui/index.scss'; |
|
|
|
@import '@/common/styles/iconfont.scss'; |
|
|
|
@import '@/common/styles/app.scss'; |
|
|
|
@import '@/common/styles/tailwind.scss'; |
|
|
|
@import '@/common/styles/theme/index.scss'; |
|
|
|
|
|
|
|
page { |
|
|
|
height: 100%; |
|
|
|