收藏
回答

以前可以登录的,现在不能登录了,该怎么处理呢?

小程序以前发布时可以正常使用,正常登录。最近发布新小程序时,同样的代码,提交审核时未通过,提示不能登录。进行开发者工具查看,提示:Setting data field "userInfo" to undefined is invalid.

请回这是怎么回事呢?以前可以登录的,现在不能登录了,该怎么处理呢


最后一次编辑于  2019-08-04
回答关注问题邀请回答
收藏

3 个回答

  • 吴晓怡
    吴晓怡
    发表于移动端
    2021-10-13
    不知道
    2021-10-13
    有用 1
    回复
  • *:ஐ٩(๑´ᵕ`)۶ஐ:*
    *:ஐ٩(๑´ᵕ`)۶ஐ:*
    发表于移动端
    2021-08-22
    不知道
    2021-08-22
    有用 1
    回复
  • 黄小津-AI软硬件研发-抖音MCN
    黄小津-AI软硬件研发-抖音MCN
    2019-08-04

    以下代码请大咖帮我看看,是哪里不对

    var n = require("utils/util.js");


    App({

    onLaunch: function() {

    var n = wx.getSystemInfoSync();

    if (n) {

    var t = n.windowWidth, o = n.windowHeight;

    this.globalData.phoneheight = o, this.globalData.px2rpx = 750 / t, this.globalData.rpx2px = t / 750;

    }

    this.LoginUser();

    },

    getUserInfo: function(n) {

    var t = this;

    this.globalData.userInfo ? "function" == typeof n && n(this.globalData) : wx.login({

    success: function(o) {

    var e = o.code;

    t.globalData.code = e, wx.getSetting({

    success: function(o) {

    o.authSetting["scope.userInfo"] ? wx.getUserInfo({

    success: function(o) {

    t.globalData.userInfo = o.userInfo, "function" == typeof n && n(t.globalData);

    }

    }) : "function" == typeof n && n(t.globalData);

    }

    });

    }

    });

    },

    LoginUser: function() {

    var t = this;

    this.globalData.userInfo = null, this.globalData.code = null, this.getUserInfo(function(o) {

    var e = t.siteInfo.siteroot + "?i=" + t.siteInfo.uniacid + "&c=entry&m=kuaiwei_voice&do=user", a = {

    code: o.code,

    nickname: null == o.userInfo ? "" : o.userInfo.nickName,

    avatar: null == o.userInfo ? "" : o.userInfo.avatarUrl

    };

    n.Post(e, a, function(n) {

    if (0 == n.success) {

    var t = n.openkey;

    wx.setStorageSync("openkey", t);

    }

    });

    });

    },

    globalData: {

    userInfo: null,

    code: null,

    phoneheight: null,

    px2rpx: null,

    rpx2px: null,

    vid: null,

    logintips: 0

    },

    siteInfo: require("siteinfo.js")

    });


    点击登录出现如下错误提示:


    以下是用户中心代码

    var e = require("../../utils/config").requestUrl, t = (require("../../utils/config").maintitle,

    require("../../utils/util.js")), n = getApp(), o = 0;


    Page({

    data: {

    order_no: "",

    memberdata: []

    },

    onLoad: function(e) {

    this.LoadData(0);

    },

    UserLogin: function(o) {

    var a = this, s = o.detail;

    n.globalData.userInfo = null, n.getUserInfo(function(n) {

    a.setData({

    userInfo: null == s.userInfo ? "" : s.userInfo

    });

    var o = e + "&do=user", i = {

    code: n.code,

    nickname: null == s.userInfo ? "" : s.userInfo.nickName,

    avatar: null == s.userInfo ? "" : s.userInfo.avatarUrl

    };

    t.Post(o, i, function(e) {

    if (console.log(e), wx.hideNavigationBarLoading(), 0 == e.success) {

    var t = e.openkey;

    wx.setStorageSync("openkey", t), a.LoadData(0);

    } else wx.showModal({

    title: "登录提示",

    content: "登录失败,请选择允许授权!",

    showCancel: !1

    });

    });

    });

    },

    onReady: function() {},

    onShow: function() {},

    LoadData: function(n) {

    var o = this, a = wx.getStorageSync("openkey");

    if (null != a && "" != a) {

    var s = e + "&do=memberbuy", i = {

    openkey: a

    };

    t.Post(s, i, function(e) {

    1 == n && wx.stopPullDownRefresh(), 0 != e ? 0 == e.success ? o.setData({

    memberdata: e.data

    }) : wx.showModal({

    title: "提示",

    content: e.data.msg,

    showCancel: !1,

    success: function(e) {}

    }) : wx.showModal({

    title: "提示",

    content: "您的网络有异常,下拉刷新试试看~~~",

    showCancel: !1,

    success: function(e) {}

    });

    });

    }

    },

    OnMemberPay: function(n) {

    var a = this, s = n.currentTarget.dataset.id, i = n.currentTarget.dataset.price, c = wx.getStorageSync("openkey"), r = s == o ? this.data.order_no : "";

    if (o = s, null != c && "" != c) {

    var u = e + "&do=memberpay", l = {

    id: s,

    price: i,

    order_no: r,

    openkey: c

    };

    t.Post(u, l, function(e) {

    if (console.log(e), 0 != e) if (null != e.order_no && "" != e.order_no && a.setData({

    order_no: e.order_no

    }), 0 == e.success) {

    var t = e.packpage;

    wx.requestPayment({

    timeStamp: t.timeStamp,

    nonceStr: t.nonceStr,

    package: t.package,

    signType: "MD5",

    paySign: t.paySign,

    success: function(e) {

    wx.showToast({

    title: "支付成功",

    icon: "success",

    duration: 1e3

    }), a.setData({

    order_no: ""

    }), a.LoadData(0);

    },

    fail: function(e) {

    wx.showToast({

    title: "支付失败",

    icon: "success",

    duration: 1e3

    });

    }

    });

    } else wx.showToast({

    title: e.msg,

    icon: "success",

    duration: 1e3

    }); else wx.showModal({

    title: "提示",

    content: "您的网络有异常,下拉刷新试试看~~~",

    showCancel: !1,

    success: function(e) {}

    });

    });

    }

    },

    OnNavList: function(n) {

    var o = n.currentTarget.dataset.isfree, a = n.currentTarget.dataset.ismember, s = n.currentTarget.dataset.id;

    if (0 == o && 0 == a) wx.navigateTo({

    url: "../list/base?id=" + s

    }); else {

    var i = wx.getStorageSync("openkey");

    if (null != i && "" != i) {

    var c = e + "&do=iscoursepay", r = {

    id: s,

    openkey: i

    };

    t.Post(c, r, function(e) {

    0 != e ? 0 == e.success ? wx.navigateTo({

    url: "../list/list?id=" + s

    }) : 1 == e.success ? wx.navigateTo({

    url: "../list/list?id=" + s

    }) : wx.showModal({

    title: "提示",

    content: "用户授权失败,请下拉刷新试试!",

    showCancel: !1,

    success: function(e) {}

    }) : wx.showModal({

    title: "提示",

    content: "您的网络有异常,下拉刷新试试看~~~",

    showCancel: !1,

    success: function(e) {}

    });

    });

    }

    }

    },

    onHide: function() {},

    onUnload: function() {},

    onPullDownRefresh: function() {

    this.LoadData(1);

    },

    onReachBottom: function() {},

    onShareAppMessage: function() {}

    });


    2019-08-04
    有用
    回复
登录 后发表内容