明天专门搞详情

This commit is contained in:
xiaoronghao
2023-04-12 19:29:41 +08:00
parent fb44b267bd
commit d5ab2ca459
24 changed files with 196 additions and 158 deletions

View File

@@ -85,4 +85,14 @@ function updateURLSearchParams(obj = {}) {
window.history.pushState({}, '', newUrl);
}
export { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams }
// 清除所有cookies
function clearCookies() {
let cookies = document.cookie.split("; ");
for (let c of cookies) {
let [name, _] = c.split("=");
document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
}
}
export { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams, clearCookies }

View File

@@ -16,6 +16,7 @@ baseURL = {
offer: "https://offer.gter.net",
tenement: "https://app.gter.net",
}
const service = axios.create({
@@ -27,7 +28,6 @@ const service = axios.create({
service.interceptors.request.use(config => {
//发请求前做的一些处理数据转化配置请求头设置token,设置loading等根据需求去添加
//注意使用token的时候需要引入cookie方法或者用本地localStorage等方法推荐js-cookie
// config['baseURL'] = "https://offer.gter.net"
config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
return config
}, error => {