fix: 更新API基础URL并添加分享时间验证
修改vite配置添加base路径 更新开发环境和生产环境的API基础URL 在新闻详情页添加分享时间验证逻辑,超过24小时则刷新页面
This commit is contained in:
parent
16b84d9d19
commit
cd93d6d06d
|
|
@ -5,7 +5,7 @@ ENV = development
|
|||
# VITE_API_URL = http://123.60.153.169:8040/apih5
|
||||
# VITE_API_URL = https://4155gf93ll13.vicp.fun/apih5
|
||||
# VITE_API_URL = http://123.60.79.143:8041/apih5
|
||||
VITE_API_URL = http://192.168.3.38:8040/apih5
|
||||
# VITE_API_URL = https://cankao.cs.com.cn/apih5
|
||||
# VITE_API_URL = http://192.168.3.38:8040/apih5
|
||||
VITE_API_URL = https://cankao.cs.com.cn/apih5
|
||||
|
||||
VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav
|
||||
|
|
@ -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://123.60.153.169:8042/apih5";
|
||||
// export const baseUrl = "https://cankao.cs.com.cn/mini";
|
||||
// export const baseUrl = "http://123.60.153.169:8042/apih5";
|
||||
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";
|
||||
|
|
|
|||
|
|
@ -125,6 +125,17 @@ onLoad(async (option: any) => {
|
|||
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) => {
|
||||
|
|
|
|||
|
|
@ -4,15 +4,16 @@ import { resolve } from "path";
|
|||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: "/jnh/",
|
||||
plugins: [uni()],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `
|
||||
@import "@/assets/style/variable.scss";
|
||||
`
|
||||
}
|
||||
}
|
||||
`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
server: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue