编写登录用的api和后端代码

This commit is contained in:
2023-02-28 19:58:03 +08:00
parent e49f4426f3
commit 1fa3b7cfdc
9 changed files with 78 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
/*
* @Author: Kane
* @Date: 2023-02-28 19:30:40
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/api/account.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
/**
* 将url的参数拆分成对象
* @param url 访问的url
* @returns
*/
function getURL(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;
}
export { getURL };