mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix:路由处理,CSS处理,样式处理,全局变量处理
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import axiosInstance from './axios'
|
||||
import { RequestEnum, ContentTypeEnum } from '@/enums/httpEnum'
|
||||
|
||||
// 缓存处理
|
||||
const filterUrl = (url: string) => {
|
||||
return url.indexOf('?') !== -1 ? `${url}&time=${new Date().getTime()}` : `${url}?time=${new Date().getTime()}`
|
||||
}
|
||||
|
||||
export const get = (params: object, url: string) => {
|
||||
return axiosInstance({
|
||||
url: filterUrl(url),
|
||||
method: RequestEnum.GET,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const post = (params: object, url: string, headersType: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestEnum.POST,
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const del = (params: object, url: string) => {
|
||||
return axiosInstance({
|
||||
url: filterUrl(url),
|
||||
method: RequestEnum.DELETE,
|
||||
params
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user