408249787@qq.com 3 tygodni temu
rodzic
commit
6dffca9ea4
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      pages/index/components/exchange.uvue

+ 5 - 1
pages/index/components/exchange.uvue

@@ -2,7 +2,7 @@
 import { ref } from 'vue'
 import { exchangeCode } from '@/services/user'
 import { dict } from '@/.cool/store'
-import { user } from '@/.cool'
+import { user, router } from '@/.cool'
 
 import { useUi } from "@/uni_modules/cool-ui";
 
@@ -10,6 +10,10 @@ const ui = useUi();
 const code = ref<string>('')
 
 async function handleExchange() {
+  if (user.token === 'Basic ZW5kOmVuZA==') {
+    router.push({ path: '/pages/user/login' })
+    return
+  }
   if (!code.value) {
     uni.showToast({
       title: '请输入兑换码',