|
@@ -120,6 +120,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted } from 'vue';
|
|
import { ref, onMounted } from 'vue';
|
|
|
import { getOrderDetail, OrderInfo } from '../../api/order';
|
|
import { getOrderDetail, OrderInfo } from '../../api/order';
|
|
|
|
|
+import { checkAuth } from '../../utils/auth';
|
|
|
|
|
|
|
|
const order = ref<OrderInfo | null>(null);
|
|
const order = ref<OrderInfo | null>(null);
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
@@ -204,9 +205,14 @@ const loadOrderDetail = async () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 页面加载时获取订单详情
|
|
|
|
|
|
|
+ * 页面加载时检查登录状态并获取订单详情
|
|
|
*/
|
|
*/
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ // 检查登录状态
|
|
|
|
|
+ if (!checkAuth()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const pages = getCurrentPages();
|
|
const pages = getCurrentPages();
|
|
|
const currentPage = pages[pages.length - 1] as any;
|
|
const currentPage = pages[pages.length - 1] as any;
|
|
|
const options = currentPage.options || {};
|
|
const options = currentPage.options || {};
|