mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-12-17 08:46:57 +08:00
25 lines
610 B
TypeScript
25 lines
610 B
TypeScript
import { useAxiosInterceptor } from '@/axios/utils/interceptor'
|
|
import implement from './provider'
|
|
|
|
const { setImplement } = useAxiosInterceptor()
|
|
|
|
export const setupResponseInterceptor = () => {
|
|
const { implementResponseInterceptorArray } = implement
|
|
|
|
setImplement(
|
|
'implementResponseInterceptorArray',
|
|
implementResponseInterceptorArray,
|
|
'ok',
|
|
)
|
|
}
|
|
|
|
export const setupResponseErrorInterceptor = () => {
|
|
const { implementResponseInterceptorErrorArray } = implement
|
|
|
|
setImplement(
|
|
'implementResponseInterceptorErrorArray',
|
|
implementResponseInterceptorErrorArray,
|
|
'error',
|
|
)
|
|
}
|