2019-12-11 07:19:32 +00:00
|
|
|
<script>
|
2020-03-11 00:39:08 +00:00
|
|
|
import { mapMutations } from 'vuex';
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
...mapMutations(['login'])
|
|
|
|
},
|
|
|
|
onLaunch: function() {
|
|
|
|
let userInfo = uni.getStorageSync('userInfo') || '';
|
|
|
|
if (userInfo.id) {
|
|
|
|
//更新登陆状态
|
|
|
|
uni.getStorage({
|
|
|
|
key: 'userInfo',
|
|
|
|
success: res => {
|
|
|
|
this.login(res.data);
|
|
|
|
}
|
|
|
|
});
|
2019-12-11 07:19:32 +00:00
|
|
|
}
|
2020-03-11 00:39:08 +00:00
|
|
|
},
|
|
|
|
onShow: function() {
|
|
|
|
console.log('App Show');
|
|
|
|
},
|
|
|
|
onHide: function() {
|
|
|
|
console.log('App Hide');
|
2019-12-11 07:19:32 +00:00
|
|
|
}
|
2020-03-11 00:39:08 +00:00
|
|
|
};
|
2019-12-11 07:19:32 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2020-03-11 00:39:08 +00:00
|
|
|
/*每个页面公共css */
|
|
|
|
/*每个页面公共css */
|
|
|
|
@import 'colorui/main.css';
|
|
|
|
@import 'colorui/icon.css';
|
2019-12-11 07:19:32 +00:00
|
|
|
</style>
|