202404 入场需要查看免责声明

This commit is contained in:
2024-05-26 20:25:06 +08:00
parent 8b1c94b806
commit 298a18e933
7 changed files with 100 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
//testURL
// const BASE_URL = 'http://127.0.0.1:8093';
// const BASE_URL = 'http://192.168.31.173:8093';
// const BASE_URL = 'http://192.168.1.3:8093';
//prodURL
const BASE_URL = 'https://api.hongyutiyu.top';
// const platformId = 1;
@@ -334,6 +334,10 @@ export default {
aboutUs(params) {
return fetchGet('/about/uss', params, false);
},
// 免责声明
disclaimersDetail(params) {
return fetchGet('/notice/disclaimers', params, false);
},
// 上传图像
uploadAvatar(params) {
return fetchPost('/upload/avatar', params, true, true);

View File

@@ -26,7 +26,36 @@ const getCurrentPageUrl = () => {
return url;
}
const setTimeOutStorage = (key,value,timeout) => {
let timestamp = Date.parse(new Date());
wx.setStorageSync(key,
{
'value': value,
'timeout': timestamp + timeout
})
}
const getTimeoutStorage = (key) => {
// 当前时间
let timestamp = Date.parse(new Date());
// 缓存中的过期时间
let data = wx.getStorageSync(key);
let data_expiration = data.timeout;
let value = data.value;
// 如果缓存中没有data_expiration说明也没有token还未登录
if (data_expiration) {
// 如果超时了,清除缓存,重新登录
if (timestamp > data_expiration) {
wx.removeStorageSync(key);
return null;
}
}
return value;
}
module.exports = {
formatTime: formatTime,
getCurrentPageUrl: getCurrentPageUrl
getCurrentPageUrl: getCurrentPageUrl,
setTimeOutStorage: setTimeOutStorage,
getTimeoutStorage: getTimeoutStorage
}