1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <view class="content">
-
- </view>
- </template>
- <script>
- import {
- ref
- } from 'vue';
- export default {
- data() {
- const token = ref(null)
- const user = ref(null)
- return {
- token,
- user,
- }
- },
- onLoad() {
- },
- onShow() {
- this.token = uni.getStorageSync('token');
- this.user = uni.getStorageSync('user');
- },
- methods: {
- avatarClick() {
- if (this.token) {
- } else {
- uni.navigateTo({
- url: "/pages/login/index"
- })
- }
- },
- logout() {
- uni.removeStorageSync('token')
- uni.removeStorageSync('user')
- this.token = uni.getStorageSync('token');
- this.user = uni.getStorageSync('user');
- },
- dialogToggle() {
- this.$refs.alertDialog.open()
- },
- }
- }
- </script>
- <style>
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
-
- </style>
|