-
Notifications
You must be signed in to change notification settings - Fork 0
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
14 changed files
with
256 additions
and
106 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
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 @@ | ||
export interface tableDataType { | ||
id:number, | ||
name:string, | ||
description:string, | ||
is_use:number, | ||
sex: number | ||
} | ||
|
||
export interface pagenationType { | ||
pageSize: number, | ||
pageNum: number, | ||
} |
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,6 @@ | ||
import { httpReq } from "@/service/request"; | ||
|
||
const commonApi = { | ||
getList:(params?: any) => httpReq.get("/list", {params}) | ||
} | ||
export default commonApi; |
This file was deleted.
Oops, something went wrong.
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,3 +1,34 @@ | ||
import service from "@/service/axios"; | ||
import type { AxiosError,AxiosRequestConfig,AxiosResponse } from "axios"; | ||
import axios from 'axios'; | ||
import type { AxiosError,AxiosResponse,InternalAxiosRequestConfig,AxiosInstance } from "axios"; | ||
|
||
|
||
const service:AxiosInstance = axios.create({ | ||
// baseURL: 'http://localhost:4523', | ||
baseURL: 'http://127.0.0.1:4523/m1/2897880-0-default', | ||
timeout: 5000 | ||
}); | ||
|
||
var loadingInstance:any = null; | ||
|
||
service.interceptors.request.use((config:InternalAxiosRequestConfig) => { | ||
loadingInstance = ElLoading.service({ fullscreen: true }); | ||
return config; | ||
},(error:AxiosError) => { | ||
return Promise.reject(error); | ||
}); | ||
|
||
service.interceptors.response.use((response:AxiosResponse) => { | ||
loadingInstance.close(); | ||
const {data,message,code} = response.data; | ||
if(code === 0){ | ||
return data | ||
} else { | ||
ElMessage.error(message); | ||
return Promise.reject(message); | ||
} | ||
},(error:any) => { | ||
loadingInstance.close(); | ||
return Promise.reject(error); | ||
}); | ||
|
||
export default service; |
Oops, something went wrong.