fix: 更新生产环境API地址并优化登录处理逻辑
- 将生产环境API地址切换为正式域名 - 修改登录失效处理方式为页面刷新而非跳转 - 优化rank.vue页面布局和路由参数处理 - 移除登录页面的token参数
This commit is contained in:
parent
3ab1dfae30
commit
11a885d039
|
|
@ -3,8 +3,8 @@ ENV = production
|
|||
|
||||
# 线上环境接口地址
|
||||
# VITE_API_URL = https://cankao.cs.com.cn/mini
|
||||
VITE_API_URL = http://123.60.153.169:8040/apih5
|
||||
# VITE_API_URL = https://cankao.cs.com.cn/apih5
|
||||
# VITE_API_URL = http://123.60.153.169:8040/apih5
|
||||
VITE_API_URL = https://cankao.cs.com.cn/apih5
|
||||
|
||||
# VITE_API_URL = http://123.60.79.143:8041/apih5
|
||||
|
||||
|
|
|
|||
|
|
@ -7,14 +7,9 @@
|
|||
<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>
|
||||
<u-input
|
||||
v-if="pageType == 4"
|
||||
placeholder="请输入搜索内容"
|
||||
v-model="form.keyword"
|
||||
prefixIcon="search"
|
||||
<u-input v-if="pageType == 4" placeholder="请输入搜索内容" v-model="form.keyword" prefixIcon="search"
|
||||
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>
|
||||
<u-button @tap="getNewsList" text="搜索" size="mini"></u-button>
|
||||
</template>
|
||||
|
|
@ -40,7 +35,8 @@
|
|||
<view class="item_bottom">
|
||||
<view>
|
||||
<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>
|
||||
</view>
|
||||
|
||||
|
|
@ -50,24 +46,14 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<div style="width: 100%; display: flex; justify-content: center" v-if="pageType == 4 && newsList && newsList.length > 0">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
:page-size="form.size"
|
||||
layout="prev, pager, next"
|
||||
:total="form.total"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
/>
|
||||
<div style="width: 100%; display: flex; justify-content: center"
|
||||
v-if="pageType == 4 && newsList && newsList.length > 0">
|
||||
<el-pagination v-model:current-page="currentPage" :page-size="form.size" layout="prev, pager, next"
|
||||
:total="form.total" @current-change="currentChange" @size-change="sizeChange" />
|
||||
</div>
|
||||
</view>
|
||||
<LoginPopup
|
||||
:show="LoginShow"
|
||||
mode="center"
|
||||
@handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
||||
@handlePopupErrorCallback="handlePopupErrorCallback"
|
||||
/>
|
||||
<LoginPopup :show="LoginShow" mode="center" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||
</view>
|
||||
</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();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -57,8 +57,9 @@ service.interceptors.response.use(
|
|||
financialAccount: Session.get("userPhone"),
|
||||
});
|
||||
Session.clear(); // 清除浏览器全部临时缓存
|
||||
window.location.href = "/"; // 去登录页
|
||||
console.log("你已被登出,请重新登录");
|
||||
window.location.reload();
|
||||
// window.location.href = "/"; // 去登录页
|
||||
// console.log("你已被登出,请重新登录");
|
||||
// ElMessageBox.alert('你已被登出,请重新登录', '提示', {})
|
||||
// .then(() => {})
|
||||
// .catch(() => {});
|
||||
|
|
|
|||
Loading…
Reference in New Issue