点击用户授权报错了

发布于 7 年前作者 min108064 次浏览最后编辑 7 年前来自 issues

thirdScriptError

Cannot read property ‘parentid’ of undefined;at api request success callback function

TypeError: Cannot read property ‘parentid’ of undefined

    at success (weapp:///pages/authorize/authorize.js:51:51)

    at Function.function.o.(anonymous function) (WAService.js:1:1027087)

    at WAService.js:1:102572

    at E (WAService.js:1:393688)

    at i.<anonymous> (WAService.js:1:674939)

    at i.emit (WAService.js:1:411914)

    at Ka (WAService.js:1:675547)

    at WAService.js:1:676764

    at WAService.js:1:422173

    at Object.m (WAService.js:1:1826)

4 回复
sunxiulan
sunxiulan1 楼6 年前

先打印res.data.user_data

你可以这样写  res.data.user_data && res.data.user_data.parentid

jun28
jun282 楼6 年前

parentid是空值 你不能赋值到app.globalData.cid

dhuang
dhuang3 楼6 年前

app.globalData.cid = res.data.user_data.parentid 提示这一行有错

nazheng
nazheng4 楼5 年前

‘parentid’ of undefined

看你authorize.js咋写的咯