保存进度!

This commit is contained in:
Kane Wang 2023-03-01 16:08:00 +08:00
parent 12ce6403dd
commit 702912ef00
4 changed files with 2818 additions and 1558 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^1.3.2", "axios": "^1.3.2",
"pako": "^2.1.0" "pako": "^2.1.0",
"ts-node": "^10.9.1"
} }
} }

View File

@ -0,0 +1,77 @@
/*
* @Author: Kane
* @Date: 2023-02-28 19:30:40
* @LastEditors: Kane
* @FilePath: //src/utils/url.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
/**
* url的参数拆分成对象
* @param url 访url
* @returns
*/
function getURLParams(url: string)
{
const arr = url.split("?");
const params = arr[1].split("&");
const obj = {};
for (let i = 0; i < params.length; i++)
{
const param = params[i].split("=");
obj[param[0]] = param[1];
}
return obj;
}
function getParamsFromURL(url: string)
{
const indexOfQuestionMark: number = url.indexOf("?");
const indexOfSharp: number = url.indexOf("#");
const paramObj = {};
let paramString;
//url中没有问号说明没有参数
if (indexOfQuestionMark < 0)
{
return paramObj;
}
//检查是否有#号
if (indexOfSharp < 0)
{
//没有#号,可以直接截取参数字符串
paramString = url.substring(indexOfQuestionMark);
}
else
{
//有#号,需要排除掉#的内容
const end: number = indexOfQuestionMark < indexOfSharp ? indexOfSharp : url.length;
paramString = url.substring(indexOfQuestionMark + 1, end);
}
//拆分属性
const paramArray: string[] = paramString.split("&");
paramArray.forEach((item) =>
{
if (item.length == 0)
{
return;
}
const param = item.split("=");
paramObj[param[0]] = param[1] || "";
});
return paramObj;
}
export { getURLParams, getParamsFromURL };

View File

@ -2,10 +2,11 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-02-23 16:15:45 * @Date: 2023-02-23 16:15:45
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-23 16:16:04 * @LastEditTime: 2023-02-28 09:22:08
* @FilePath: //webpack.config.js * @FilePath: //webpack.config.js
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
const path = require("path"); // const path = require("path");
import { path } from "path";