点击用户授权报错了
发布于 6 年前 作者 min10 7863 次浏览 来自 官方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 回复

先打印res.data.user_data

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

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

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

‘parentid’ of undefined

看你authorize.js咋写的咯

回到顶部