123456789101112131415161718192021222324252627282930313233 |
- <script>
- export default {
- async onLaunch(options) {
- console.log('App Launch')
- if (this.$api.user.isLogin()) {
- await this.$api.user.info().then(res => {
- this.$store.dispatch('user/info', res.data)
- })
- } else {
- await this.$api.user.login().then(res => {
- const { token, user_info } = res.data
- this.$store.dispatch('user/token', token)
- this.$store.dispatch('user/info', user_info)
- })
- }
- },
- onShow() {
- console.log('App Show')
- },
- onHide() {
- console.log('App Hide')
- }
- }
- </script>
- <style lang="scss">
- /*每个页面公共css */
- @import "@/uni_modules/uview-ui/index.scss";
- @import '@/static/css/flex.scss';
- @import '@/static/css/common.scss';
- @import '@/static/css/iconfont.css';
- </style>
|