1.vuex can not be used directly in the template (can be used in a script)
<view class="nickname">{{$store.state.userInfo.nickname}}</view>
Get not shown above, the solution: compoted is introduced in the current vue like mapState
computed: { ...mapState(['userInfo']), ...mapGetters(['hasLogin']) },
template can be directly read as follows
<view class="nickname">{{userInfo.nickname}}</view>