diff --git a/src/api/index.ts b/src/api/index.ts index e3dfe05..bb8e713 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -74,5 +74,5 @@ export const editTopNews = (data: any) => { // 编辑精选接口 export const sendToken = (data: any) => { - return Request.post("/common/forward/financiald", data); + return Request.post("/common/forward/financial", data); }; diff --git a/src/pages/realtimeInfo/pc/rank.vue b/src/pages/realtimeInfo/pc/rank.vue index 5bca493..d422a0a 100644 --- a/src/pages/realtimeInfo/pc/rank.vue +++ b/src/pages/realtimeInfo/pc/rank.vue @@ -129,17 +129,31 @@ function currentChange(page) { onMounted(async (e) => { console.log("🚀 ~ route.query:", route.query) - if (route.query?.token) { + if (route.query?.token && !Session.get("token")) { + uni.showLoading({ + title: '加载中', + mask: true + }) sendToken({ token: route.query.token, + }).then((res) => { + uni.hideLoading() + if (res.code == 200) { + Session.set("token", res.data.token); + Session.set("userPhone", res.data.phone); + + window.location.reload(); + } }) + } else { + if (!Session.get("token")) { + LoginShow.value = true; + } } getNewsList(); - if (!Session.get("token")) { - LoginShow.value = true; - } + }); const LoginShow = ref(false);