This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "活动游戏",
|
||||
navigationBarTitleText: '',
|
||||
});
|
||||
|
||||
@@ -5,14 +5,26 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useLoad, getStorageSync } from "@tarojs/taro";
|
||||
import {ref} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const url = ref("");
|
||||
const url = ref('');
|
||||
|
||||
useLoad(() => {
|
||||
// const user = getStorageSync("userInfo");
|
||||
url.value = `${process.env.TARO_APP_GAME}${getStorageSync("token")}`;
|
||||
Taro.useDidShow(() => {
|
||||
const token = Taro.getStorageSync('token');
|
||||
if (token) {
|
||||
url.value = `${process.env.TARO_APP_GAME}${Taro.getStorageSync('token')}`;
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: '请先登录,再尝试进入游戏大厅。',
|
||||
icon: 'none',
|
||||
});
|
||||
setTimeout(() => {
|
||||
Taro.switchTab({
|
||||
url: '/pages/index/index',
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user