-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
300 additions
and
263 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
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,20 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link | ||
rel="icon" | ||
href="/favicon.svg" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0" /> | ||
<title>%VITE_APP_NAME%</title> | ||
</head> | ||
<body> | ||
<div id="appLoading"></div> | ||
<div id="app"></div> | ||
<script | ||
type="module" | ||
src="/src/main.ts"></script> | ||
</body> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>%VITE_APP_NAME%</title> | ||
</head> | ||
|
||
<body> | ||
<div id="appLoading"></div> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></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,19 +1,19 @@ | ||
import { mockRequest } from '../http' | ||
import { alovaInstance } from '../http' | ||
|
||
interface Ilogin { | ||
username: string | ||
password: string | ||
} | ||
|
||
export function fetchLogin(params: Ilogin) { | ||
return mockRequest.post<any>('/login', params) | ||
return alovaInstance.Post<any>('/login', params) | ||
} | ||
export function fetchUpdateToken(params: any) { | ||
return mockRequest.post<ApiAuth.loginToken>('/updateToken', params) | ||
return alovaInstance.Post<ApiAuth.loginToken>('/updateToken', params) | ||
} | ||
export function fetchUserInfo(params: any) { | ||
return mockRequest.get<Auth.UserInfo>('/getUserInfo', { params }) | ||
return alovaInstance.Get<Auth.UserInfo>('/getUserInfo', { params }) | ||
} | ||
export function fetchUserRoutes(params: { id: number }) { | ||
return mockRequest.get<AppRoute.Route[]>('/getUserRoutes', { params }) | ||
return alovaInstance.Get<AppRoute.Route[]>('/getUserRoutes', { params }) | ||
} |
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,5 +1,5 @@ | ||
import { mockRequest } from '../http' | ||
import { alovaInstance } from '../http' | ||
|
||
export function fetchUserList() { | ||
return mockRequest.get('/userList') | ||
return alovaInstance.Get('/userList') | ||
} |
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,45 +1,45 @@ | ||
import { mockRequest, request } from '../http' | ||
import qs from 'qs' | ||
import { alovaInstance } from '../http' | ||
|
||
/* get方法测试 */ | ||
export function fetachGet(params?: any) { | ||
return request.get('/getAPI', { params }) | ||
return alovaInstance.Get('/getAPI', { params }) | ||
} | ||
/* post方法测试 */ | ||
export function fetachPost(data: any) { | ||
return request.post('/postAPI', data) | ||
return alovaInstance.Post('/postAPI', data) | ||
} | ||
/* formPost方法测试 */ | ||
export function fetachFormPost(data: any) { | ||
return request.formPost('/postAPI', data) | ||
return alovaInstance.Post('/postAPI', qs.stringify(data), { | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}, | ||
}) | ||
} | ||
/* delete方法测试 */ | ||
export function fetachDelete() { | ||
return request.delete('/deleteAPI') | ||
return alovaInstance.Delete('/deleteAPI') | ||
} | ||
/* put方法测试 */ | ||
export function fetachPut(data: any) { | ||
return request.put('/putAPI', data) | ||
return alovaInstance.Put('/putAPI', data) | ||
} | ||
|
||
/* 测试状态码500失败 */ | ||
export function testFailedRequest() { | ||
return request.get('/filedRequest') | ||
return alovaInstance.Get('/serverError') | ||
} | ||
|
||
/* 测试业务码500失败 */ | ||
export function testFailedResponse() { | ||
return request.get('/filedResponse') | ||
return alovaInstance.Post('/businessError') | ||
} | ||
/* 测试token刷新接口 */ | ||
export function testUpdataToken() { | ||
return request.get('/updataToken') | ||
/* token失效的接口 */ | ||
export function expiredTokenRequest() { | ||
return alovaInstance.Get('/expiredToken') | ||
} | ||
/* 测试token刷新接口 */ | ||
export function testFailedResponse_NT() { | ||
return request.get('/failedResponse_NT') | ||
} | ||
|
||
/* mock方法测试 */ | ||
export function fetchMock() { | ||
return mockRequest.post('/login') | ||
export function refreshToken() { | ||
return alovaInstance.Get('/updataToken') | ||
} |
Oops, something went wrong.