fix: 更新API基础URL并添加分享时间验证

修改vite配置添加base路径
更新开发环境和生产环境的API基础URL
在新闻详情页添加分享时间验证逻辑,超过24小时则刷新页面
This commit is contained in:
34701892@qq.com 2025-12-22 11:04:25 +08:00
parent 16b84d9d19
commit cd93d6d06d
4 changed files with 19 additions and 7 deletions

View File

@ -5,7 +5,7 @@ ENV = development
# VITE_API_URL = http://123.60.153.169:8040/apih5 # VITE_API_URL = http://123.60.153.169:8040/apih5
# VITE_API_URL = https://4155gf93ll13.vicp.fun/apih5 # VITE_API_URL = https://4155gf93ll13.vicp.fun/apih5
# VITE_API_URL = http://123.60.79.143:8041/apih5 # VITE_API_URL = http://123.60.79.143:8041/apih5
VITE_API_URL = http://192.168.3.38:8040/apih5 # VITE_API_URL = http://192.168.3.38:8040/apih5
# VITE_API_URL = https://cankao.cs.com.cn/apih5 VITE_API_URL = https://cankao.cs.com.cn/apih5
VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav

View File

@ -1,7 +1,7 @@
// const baseUrl = "http://192.168.31.25:8060/api"; // 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 = "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 = "https://cankao.cs.com.cn/zzck_datav";
// export const baseUrlDataV = "http://123.60.153.169:9995/zzck_datav"; // export const baseUrlDataV = "http://123.60.153.169:9995/zzck_datav";

View File

@ -125,6 +125,17 @@ onLoad(async (option: any) => {
wxShare(); wxShare();
} }
} }
// time
let shareTime = option?.time || 0;
// 24
if (Date.now() - shareTime > 24 * 60 * 60 * 1000) {
uni.removeStorageSync("token");
//
uni.reLaunch({
url: curPages[curPages.length - 1].route,
});
}
}); });
const newList = async (columnId: number) => { const newList = async (columnId: number) => {

View File

@ -4,15 +4,16 @@ import { resolve } from "path";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: "/jnh/",
plugins: [uni()], plugins: [uni()],
css: { css: {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
additionalData: ` additionalData: `
@import "@/assets/style/variable.scss"; @import "@/assets/style/variable.scss";
` `,
} },
} },
}, },
server: { server: {