亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

json.parse

json.parse

慕少森 2018-12-21 15:14:48
selectEportStatus (query) {      this.$http.get('/api/eport/wfas/eportDecl/selectAll', {        params: query      }).then((response) => {        if (response.data.status === 200) {          var result = response.data.result          if (result) {            result = JSON.parse(result)          }          console.log(result)          if (!result || !result.list) {            this.tableStatusData = []            this.tableDataTotal = 0          } else {            this.tableStatusData = result.list            this.tableDataTotal = parseInt(result.count)          }          if (this.tableDataTotal > 0) {            this.isShow = true          } else {            this.isShow = false          }        }      })    }目前的問題是在開發環境Json.parse沒有報錯 但是在測試環境報了這個錯:Unexpected string in JSON at position 901 。相同的數據為什么會出現這種情況啊
查看完整描述

1 回答

?
胡子哥哥

TA貢獻1825條經驗 獲得超6個贊

JSON.parse是字符串轉對象,你這個傳過來的確定是字符串嗎


查看完整回答
反對 回復 2019-01-21
  • 1 回答
  • 0 關注
  • 510 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號