VM596:1 thirdScriptError Cannot read property 'type' of undefined;at api request success callback function TypeError: Cannot read property 'type' of undefined at e (http: //127 .0.0.1:41426 /appservice/jy_fristcs/utils/util .js:34:58) at Object.success (http: //127 .0.0.1:41426 /appservice/jy_fristcs/utils/util .js:27:16) at http: //127 .0.0.1:41426 /appservice/we7/resource/js/util .js:94:69 at o.(anonymous function ) (WAService.js:1:1131034) at MC (WAService.js:1:1091186) at Function.success (WAService.js:1:1092853) at WAService.js:1:102995 at C (WAService.js:1:437200) at i.<anonymous> (WAService.js:1:705916) at i.emit (WAService.js:1:462750) |
/appservice/jy_fristcs/utils/util
.js
function e(t, a, e, i) { var o = s(); if ( "jy_fristcs/pages/wifi/wifi" == o) if ( 2 == i[ 0 ].type) wx.navigateTo({ url: "/jy_fristcs/pages/web/web?url=" + encodeURIComponent (i[ 0 ].url) }); else if ( 1 == i[ 0 ].type && (d = i[ 0 ].url1.split( "?" )[ 0 ]) != o) return void wx.redirectTo({ url: "/" + i[ 0 ].url1 }); for ( var r = 0 ; r < i.length; r++) if (i[r].sel = ! 1 , 1 == i[r].type) { var d = i[r].url1; n() == d && ( "" != i[r].vice_name ? wx.setNavigationBarTitle({ title: i[r].vice_name }) : wx.setNavigationBarTitle({ title: i[r].name }), i[r].sel = ! 0 ); } t.setData({ muenList: { data: i, url: a, sel: o, color: e }, isshz: ! 1 }); } |
appservice/we7/resource/js/util
.js
wx.request((_defineProperty(t = { url: o, data: e.data ? e.data : {}, header: e.header ? e.header : {}, method: e.method ? e.method : "GET" }, "header" , { "content-type" : "application/x-www-form-urlencoded" }), _defineProperty(t, "success" , function (t) { if (wx.hideNavigationBarLoading(), wx.hideLoading(), t.data.errno) { if ( "41009" == t.data.errno) return wx.setStorageSync( "userInfo" , "" ), void util.getUserInfo( function () { util.request(e); }); if (e.fail && "function" == typeof e.fail) e.fail(t); else if (t.data.message) { if ( null != t.data.data && t.data.data.redirect) var n = t.data.data.redirect; else n = "" ; a.util.message(t.data.message, n, "error" ); } } else if (e.success && "function" == typeof e.success && e.success(t), e.cachetime) { var r = { data: t.data, expire: f + 1e3 * e.cachetime }; wx.setStorageSync(u, r); } }), _defineProperty(t, "fail" , function (t) { wx.hideNavigationBarLoading(), wx.hideLoading(); var n = require( "md5.js" )(o), a = wx.getStorageSync(n); if (a && a.data) return e.success && "function" == typeof e.success && e.success(a), console.log( "failreadcache:" + o), ! 0 ; e.fail && "function" == typeof e.fail && e.fail(t); }), _defineProperty(t, "complete" , function (t) { e.complete && "function" == typeof e.complete && e.complete(t); }), t)); }, util.getUserInfo = function (e) { var t = function () { console.log( "start login" ); var t = { sessionid: "" , wxInfo: "" , memberInfo: "" }; |
找一下这个type呗。
你不应该在这里问这个问题,你因该问自己。错误很清楚,type 没有定义。 type 是来自
i[0].type
那i是你在哪定义的。回去你的代码找。