mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-22 06:40:43 +08:00
15 lines
416 B
JavaScript
15 lines
416 B
JavaScript
import axios from 'axios'
|
|
import {store} from "@/main";
|
|
|
|
const service = axios.create({
|
|
baseURL: location.pathname.slice(0, -'/admin/'.length) + "/api", // api的base_url
|
|
timeout: 5000, // request timeout
|
|
validateStatus: function (status) {
|
|
if (status === 403) {
|
|
store.authed = false
|
|
}
|
|
return status >= 200 && status < 300 // 默认的
|
|
}
|
|
})
|
|
|
|
export default service |