Axios.create sets baseUrl, but the actual requested baseUrl is still localhost.

http.js

const service = axios.create({
        baseUrl: "//apixh-beta.17win.com", // window.xhHost["solar-api"], // "apixh-beta.17win.com",
        timeout: 5000
    })
service.interceptors.request.use(
    config => {
        //...
    },
    err => {
        //...
    }
)
// ...
export default service

api.js

import Http from "@/http"

export default {
    getData (params) {
        console.log("get my cert...")
        return Http({url:"/api/XXX", method: "get", params})
    }}

home.js

  import Service from "@/api.js"

  Service.getMyCert({}).then(response => {}) // request URL: http://localhost:3000/api/xxx

axios.create sets baseUrl, but the actual requested baseUrl is still localhost:3000/api/xxx


getMyCert () passes an empty object.


found the reason. BaseUrl should be baseURL

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b318a8-2b51d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b318a8-2b51d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?