-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from LoCyan-Team/request-refactor
重构 API 请求部分
- Loading branch information
Showing
108 changed files
with
2,540 additions
and
1,256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package.json | ||
_deprecated/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="zh-CN"> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<title>LoCyanFrp 2.0 Dashboard</title> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>LoCyanFrp 2 Dashboard</title> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-KWN2LXQ8RV"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
window.dataLayer = window.dataLayer || [] | ||
|
||
function gtag() { | ||
dataLayer.push(arguments); | ||
} | ||
function gtag() { | ||
dataLayer.push(arguments) | ||
} | ||
|
||
gtag('js', new Date()); | ||
gtag('js', new Date()) | ||
|
||
gtag('config', 'G-KWN2LXQ8RV'); | ||
gtag('config', 'G-KWN2LXQ8RV') | ||
</script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
autoprefixer: {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const base = { | ||
api_v1_url: 'https://api.locyanfrp.cn', | ||
api_v2_url: 'https://api-v2.locyanfrp.cn/api/v2', | ||
buildResponse: (res: any, useDataPath: boolean = true) => { | ||
return { | ||
status: res.status as number, | ||
data: useDataPath ? res.data.data : res.data | ||
} | ||
} | ||
} | ||
|
||
export default base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import v1 from './v1' | ||
import v2 from './v2' | ||
|
||
const api = { | ||
v1: v1, | ||
v2: v2 | ||
} | ||
|
||
export default api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import base from '@/api/base' | ||
//@ts-ignore | ||
import { get } from '@/utils/request' | ||
|
||
const EditEmail = async (username: string, token: string, email: string, code: string) => { | ||
const rs = await get(`${base.api_v1_url}/Account/EditEmail`, { | ||
username: username, | ||
token: token, | ||
email: email, | ||
code: code | ||
}) | ||
return base.buildResponse(rs, false) | ||
} | ||
|
||
export default EditEmail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import base from '@/api/base' | ||
//@ts-ignore | ||
import { get } from '@/utils/request' | ||
|
||
const SendEditMail = async (username: string, token: string, email: string) => { | ||
const rs = await get(`${base.api_v1_url}/Account/SendEditMail`, { | ||
username: username, | ||
token: token, | ||
email: email | ||
}) | ||
return base.buildResponse(rs, false) | ||
} | ||
|
||
export default SendEditMail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import EditEmail from './EditEmail' | ||
import SendEditMail from './SendEditMail' | ||
|
||
export default { | ||
EditEmail: EditEmail, | ||
SendEditMail: SendEditMail | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import base from '@/api/base' | ||
//@ts-ignore | ||
import { get } from '@/utils/request' | ||
|
||
/** | ||
* 获取公告 | ||
* @returns { | ||
* status: int, | ||
* data: { | ||
* broadcast: string | ||
* } | ||
* } | ||
*/ | ||
const GetBroadCast = async () => { | ||
const rs = await get(`${base.api_v1_url}/App/GetBroadCast`, {}) | ||
return base.buildResponse(rs, false) | ||
} | ||
|
||
export default GetBroadCast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import base from '@/api/base' | ||
//@ts-ignore | ||
import { get } from '@/utils/request' | ||
|
||
/** | ||
* 获取公告 | ||
* @returns { | ||
* status: int, | ||
* data: { | ||
* url: string, | ||
* name: string, | ||
* } | ||
* } | ||
*/ | ||
const GetCSApp = async () => { | ||
const rs = await get(`${base.api_v1_url}/App/GetCSApp`, {}) | ||
return base.buildResponse(rs, false) | ||
} | ||
|
||
export default GetCSApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import base from '@/api/base' | ||
//@ts-ignore | ||
import { get } from '@/utils/request' | ||
|
||
/** | ||
* 获取通知 | ||
* @returns { | ||
* status: int, | ||
* data: { | ||
* ads: string, | ||
* content: string | ||
* } | ||
* } | ||
*/ | ||
const root = async () => { | ||
const rs = await get(`${base.api_v1_url}/App`, {}) | ||
return base.buildResponse(rs, false) | ||
} | ||
|
||
export default root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import root from './_root' | ||
import GetBroadCast from './GetBroadCast' | ||
import GetCSApp from './GetCSApp' | ||
|
||
export default { | ||
root: root, | ||
GetBroadCast: GetBroadCast, | ||
GetCSApp: GetCSApp | ||
} |
Oops, something went wrong.