底座全局数据协调
This commit is contained in:
@@ -35,23 +35,22 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapMutations} from 'vuex'
|
||||
import {mapMutations, mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "home",
|
||||
data() {
|
||||
return {
|
||||
code: '',
|
||||
token: null,
|
||||
user: null,
|
||||
apps: [],
|
||||
search: ""
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user', 'token']),
|
||||
isApprove() {
|
||||
return this.user && this.user.status == 2;
|
||||
return this.user?.status == 2;
|
||||
},
|
||||
appsList() {
|
||||
let {search} = this
|
||||
@@ -79,10 +78,8 @@ export default {
|
||||
})
|
||||
},
|
||||
getAuth() {
|
||||
this.token = uni.getStorageSync("token");
|
||||
this.user = uni.getStorageSync("userInfo");
|
||||
this.$nextTick(() => {
|
||||
this.token && this.getUserInfo()
|
||||
this.getUserInfo()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user