<template> <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']"> <tm-message ref="toast"></tm-message> <tm-menubars title="我的" :shadow="0" :showback="false"></tm-menubars> <tm-button theme="primary" @click="show=true">退出</tm-button> <tm-button theme="primary">上传图片</tm-button> <tm-button theme="primary" @click="chuangjian()">创建家庭</tm-button> <tm-dialog v-model="show" content="确认退出系统?" @confirm="queren"></tm-dialog> </view> </template> <script> import{myRequest} from '@/api/request.js' export default { data() { return { show:false }; }, onLoad() { console.log(this.$store.state) }, created() { this.sys = uni.getSystemInfoSync(); console.log(this.$store.state) }, methods: { chuangjian(){ uni.navigateTo({ url: "/pages/chuanghome/index", }) }, queren(){ var that=this; if(uni.getStorageSync("token")==""){ uni.redirectTo({ url:"/pages/login/index" }) return } myRequest({ url: "/api/Logout/logout", method:'get', data:{} }).then(res => { uni.setStorageSync("token","") uni.redirectTo({ url:"/pages/login/index" }) }) } }, } </script> <style lang="scss"> /deep/ .tm-menubars .body{ background-color: #1b1b1b !important; } </style>