加入vuex模块!

This commit is contained in:
2023-03-02 00:35:21 +08:00
parent b960ddfa5d
commit 554bb14c36
8 changed files with 4759 additions and 4680 deletions

View File

@@ -2,12 +2,14 @@
* @Author: Kane
* @Date: 2023-02-28 19:30:40
* @LastEditors: Kane
* @FilePath: /deskop_task_schedule/code/web/task_schedule/src/utils/api/url.ts
* @FilePath: /task_schedule/src/utils/api/url.ts
* @Description: 对URL的操作
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
type stringkey = Record<string, string>;
/**
* 将url的参数拆分成对象
* @param url 访问的url
@@ -17,7 +19,7 @@ function getURLParams(url: string)
{
const arr = url.split("?");
const params = arr[1].split("&");
const obj = {};
const obj: stringkey = {};
for (let i = 0; i < params.length; i++)
{
@@ -34,11 +36,12 @@ function getURLParams(url: string)
* @param url url字符串
* @returns 返回包含url中参数作为key值作为value的对象。
*/
function getParamsFromURL(url: string): any
function getParamsFromURL(url: string): stringkey
{
const indexOfQuestionMark: number = url.indexOf("?");
const indexOfSharp: number = url.indexOf("#");
const paramObj = {};
const paramObj: stringkey = {};
let paramString;
//url中没有问号说明没有参数