fix: 更新生产环境API地址并优化登录处理逻辑

- 将生产环境API地址切换为正式域名
- 修改登录失效处理方式为页面刷新而非跳转
- 优化rank.vue页面布局和路由参数处理
- 移除登录页面的token参数
This commit is contained in:
34701892@qq.com 2025-11-09 22:56:18 +08:00
parent 3ab1dfae30
commit 11a885d039
3 changed files with 25 additions and 28 deletions

View File

@ -3,8 +3,8 @@ ENV = production
# 线上环境接口地址 # 线上环境接口地址
# VITE_API_URL = https://cankao.cs.com.cn/mini # VITE_API_URL = https://cankao.cs.com.cn/mini
VITE_API_URL = http://123.60.153.169:8040/apih5 # VITE_API_URL = http://123.60.153.169:8040/apih5
# VITE_API_URL = https://cankao.cs.com.cn/apih5 VITE_API_URL = https://cankao.cs.com.cn/apih5
# VITE_API_URL = http://123.60.79.143:8041/apih5 # VITE_API_URL = http://123.60.79.143:8041/apih5

View File

@ -7,14 +7,9 @@
<text class="pageTitle" v-if="pageType != 4">资讯头条榜</text> <text class="pageTitle" v-if="pageType != 4">资讯头条榜</text>
<text class="pageTitle" v-if="pageType == 4">编辑精选</text> <text class="pageTitle" v-if="pageType == 4">编辑精选</text>
<image src="@/assets/zixun/top20_icon.png" class="title_icon" v-if="pageType != 4"></image> <image src="@/assets/zixun/top20_icon.png" class="title_icon" v-if="pageType != 4"></image>
<u-input <u-input v-if="pageType == 4" placeholder="请输入搜索内容" v-model="form.keyword" prefixIcon="search"
v-if="pageType == 4"
placeholder="请输入搜索内容"
v-model="form.keyword"
prefixIcon="search"
prefixIconStyle="font-size: 22px;color: #909399" prefixIconStyle="font-size: 22px;color: #909399"
style="margin-left: 40rpx; margin-top: 5rpx; border-radius: 20rpx" style="margin-left: 40rpx; margin-top: 5rpx; border-radius: 20rpx">
>
<template #suffix> <template #suffix>
<u-button @tap="getNewsList" text="搜索" size="mini"></u-button> <u-button @tap="getNewsList" text="搜索" size="mini"></u-button>
</template> </template>
@ -40,7 +35,8 @@
<view class="item_bottom"> <view class="item_bottom">
<view> <view>
<text class="time">{{ item.source }}</text> <text class="time">{{ item.source }}</text>
<text class="time" style="margin-left: 30rpx" v-if="pageType != 4">{{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text> <text class="time" style="margin-left: 30rpx" v-if="pageType != 4">{{
dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}</text>
<text class="time" style="margin-left: 30rpx" v-if="pageType == 4">{{ item.time }}</text> <text class="time" style="margin-left: 30rpx" v-if="pageType == 4">{{ item.time }}</text>
</view> </view>
@ -50,24 +46,14 @@
</view> </view>
</view> </view>
<div style="width: 100%; display: flex; justify-content: center" v-if="pageType == 4 && newsList && newsList.length > 0"> <div style="width: 100%; display: flex; justify-content: center"
<el-pagination v-if="pageType == 4 && newsList && newsList.length > 0">
v-model:current-page="currentPage" <el-pagination v-model:current-page="currentPage" :page-size="form.size" layout="prev, pager, next"
:page-size="form.size" :total="form.total" @current-change="currentChange" @size-change="sizeChange" />
layout="prev, pager, next"
:total="form.total"
@current-change="currentChange"
@size-change="sizeChange"
/>
</div> </div>
</view> </view>
<LoginPopup <LoginPopup :show="LoginShow" mode="center" @handlePopupClose="handlePopupClose"
:show="LoginShow" @handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
mode="center"
@handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback"
/>
</view> </view>
</template> </template>
@ -170,6 +156,16 @@ onMounted(async (e) => {
} }
} }
// token
const { token, ...otherQuery } = route.query;
// token
if (token) {
router.replace({
path: route.path, //
query: otherQuery, //
});
}
getNewsList(); getNewsList();
}); });

View File

@ -57,8 +57,9 @@ service.interceptors.response.use(
financialAccount: Session.get("userPhone"), financialAccount: Session.get("userPhone"),
}); });
Session.clear(); // 清除浏览器全部临时缓存 Session.clear(); // 清除浏览器全部临时缓存
window.location.href = "/"; // 去登录页 window.location.reload();
console.log("你已被登出,请重新登录"); // window.location.href = "/"; // 去登录页
// console.log("你已被登出,请重新登录");
// ElMessageBox.alert('你已被登出,请重新登录', '提示', {}) // ElMessageBox.alert('你已被登出,请重新登录', '提示', {})
// .then(() => {}) // .then(() => {})
// .catch(() => {}); // .catch(() => {});