fix: 更新生产环境API地址并调整用户类型权限控制

修改config中的baseUrl为生产环境地址
在indexNewsInfo.vue中添加用户类型判断,仅经理用户可显示评论功能
调整token刷新逻辑,仅对普通用户生效
This commit is contained in:
34701892@qq.com 2025-12-23 09:17:51 +08:00
parent fbcce419f2
commit 1d1bbae0c5
2 changed files with 20 additions and 11 deletions

View File

@ -1,7 +1,7 @@
// const baseUrl = "http://192.168.31.25:8060/api";
export const baseUrl = "http://127.0.0.1:8040/apih5";
// export const baseUrl = "http://127.0.0.1:8040/apih5";
// export const baseUrl = "http://123.60.153.169:8042/apih5";
// export const baseUrl = "https://cankao.cs.com.cn/mini";
export const baseUrl = "https://cankao.cs.com.cn/mini";
export const baseUrlDataV = "https://cankao.cs.com.cn/zzck_datav";
// export const baseUrlDataV = "http://123.60.153.169:9995/zzck_datav";

View File

@ -47,7 +47,7 @@
<!-- 底部栏 评论 / 收藏 -->
<Comment
v-if="isLogin && !isDomestic"
v-if="isLogin && !isDomestic && userType == 1"
:data="data"
@handleClickLike="handleClickLike"
@handleClickStar="handleClickStar"
@ -93,6 +93,8 @@ onReachBottom(() => {
console.log("🚀 ~ onReachBottom ~ onReachBottom:");
});
// 12
const userType = ref(2);
const isDomestic = ref<boolean>(false);
onLoad(async (option: any) => {
uni.pageScrollTo({
@ -135,14 +137,21 @@ onLoad(async (option: any) => {
window.location.reload();
}
console.log("🚀 ~ Date.now():", Date.now());
// time
let shareTime = option?.time || 0;
// 24
if (uni.getStorageSync("token") && Date.now() - shareTime > 24 * 60 * 60 * 1000) {
uni.removeStorageSync("token");
// 1766373354519
window.location.reload();
// 12
if (option?.userType) {
userType.value = option.userType;
}
if (option?.userType == 2) {
console.log("🚀 ~ Date.now():", Date.now());
// time
let shareTime = option?.time || 0;
// 24
if (uni.getStorageSync("token") && Date.now() - shareTime > 24 * 60 * 60 * 1000) {
uni.removeStorageSync("token");
// 1766373354519
window.location.reload();
}
}
});