x2rr / funds

自选基金助手是一款Chrome扩展,用来快速获取关注基金的实时数据,查看自选基金的实时估值情况
https://x2rr.github.io/funds/docs/dist/index.html
GNU General Public License v3.0
2.23k stars 279 forks source link

基金列表报错 #226

Closed justyeh closed 1 year ago

justyeh commented 1 year ago

基金列表是空的,看了下控制台报错了,getIndFundData方法中接口请求返回的data对象为空e.data.data.diff,导致报错

getIndFundData() {
  var t = this
    , e = "https://push2.eastmoney.com/api/qt/ulist.np/get?fltt=2&fields=f2,f3,f4,f12,f13,f14&secids=" + this.seciList.join(",") + "&_=" + (new Date).getTime();
  this.$axios.get(e).then((function(e) {
      t.loadingInd = !1,
      t.indFundData = e.data.data.diff
  }
  ))
}
{
    "data": {
        "rc": 102,
        "rt": 1,
        "svr": 2887257693,
        "lt": 1,
        "full": 1,
        "dlmkts": "",
        "data": null
    },
    "status": 200,
    "statusText": "OK",
    "headers": {
        "access-control-allow-credentials": "true",
        "access-control-allow-methods": "GET, POST, OPTIONS",
        "access-control-allow-origin": "*",
        "cache-control": "no-cache",
        "connection": "close",
        "content-length": "74",
        "content-type": "text/plain"
    },
    "config": {
        "url": "https://push2.eastmoney.com/api/qt/ulist.np/get?fltt=2&fields=f2,f3,f4,f12,f13,f14&secids=&_=1690419464316",
        "method": "get",
        "headers": {
            "Accept": "application/json, text/plain, */*"
        },
        "transformRequest": [
            null
        ],
        "transformResponse": [
            null
        ],
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1
    },
    "request": {}
}