收藏
回答

一键登录问题?

<button wx:if="{{ !isLogin }}" class="btntype="primaryopen-type="getPhoneNumberbind:getphonenumber="handleOneClickLogin">一键登录</button>

 handleOneClickLogin(e) {

    console.log(e,'e');

    if (e.detail.code{

      wx.login({

        success: async (res) => {

          console.log(res,'res');

          const data = await userAppletPhoneLogin({

            code: e.detail.code,

            jsCode: res.code

          })

          if (data.msg{

            wx.showToast({

              title: data.msg,

              icon: 'none'

            })

            return

          }

          wx.setStorageSync('userInfo', {

            ...data,

            login_code:e.detail.code,

            jsCode: res.code

          })

          this.setData({

            isLogin: true

          })

          this.getData()

        }

      })

    }

  },

为什么我在本地调试调用handleOneClickLogin方法能生效,但发布到线上就不生效

回答关注问题邀请回答
收藏

1 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    2025-06-14

    在正式版打开调试还有一种方法,就是先在开发版或体验版打开调试,再切到正式版就能看到vConsole


    2025-06-14
    有用
    回复
登录 后发表内容