Vue started to use axios request to return Chinese garbled, check the preview and response inside the Chinese is also garbled, how can it be solved.

1. Get playlist data

export function getDiscList() {
    const url = "/api/getDiscList"

    const data = Object.assign({}, commonParams, {
        platform: "yqq",
        hostUin: 0,
        sin: 0,
        ein: 29,
        sortId: 5,
        needNewCode: 0,
        categoryId: 10000000,
        rnd: Math.random(),
        format: "json"
    })

    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data)
    })
}





 2webpack.dev.js


    const express = require("express")
    const app = express()
    const apiRoutes = express.Router()
    const axios = require("axios")
    app.use("/api", apiRoutes)


     before(app) {
      app.get("/api/getDiscList", (req, res) => {
        var url = "https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg"
        axios.get(url, {
          headers: {
            referer: "https://c.y.qq.com/",
            host: "c.y.qq.com"
          },
          params: req.query
        }).then((response) => {
          res.json(response.data)
        }).catch((e) => {
          console.log(e)
        })
      })
    }
  }
  
  
  

clipboard.png

Mar.30,2021
Add this sentence in

'Content-Type':' application/x-www-form-urlencoded;charset=UTF-8'
headers. If not, replace it with the following
'Content-Type':' application/json;charset=UTF-8'



this seems to be a character encoding problem


how do you solve this problem? Can you teach me


how did you solve this problem? I also encountered this problem. I didn't understand the answer you adopted. Where did you add outCharset

?
Menu