We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
百度小程序
小程序基础库: 3.310.35 使用框架: Vue 2
<button open-type="login" @login="getLoginCallback" @tap="getLoginCallback">授权
发起授权-->允许授权-->获取回调出参,以及回调后调用checksession
1、安卓端,正常返回login:ok 2、ios端,checksession返回正常
1、安卓端,允许授权后不返回login:ok,但是checksession返回已授权 2、ios端,允许授权后返回login:ok,但是checksession返回session key expired
👽 Taro v3.4.8 Taro CLI 3.4.8 environment info: System: OS: Windows 10 Binaries: Node: 12.2.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
The text was updated successfully, but these errors were encountered:
没怎么用过百度小程序,我在最新版本(3.6.3 )试了好像正常? 代码是这样:
3.6.3
<template> <view class="index"> <text>{{ msg }}</text> <button type="primary" @tap="checkSession">checkSession</button> <button open-type="login" @login="getLoginCallback">授权登录</button> </view> </template> <script> import './index.scss'; import Taro from '@tarojs/taro'; export default { data() { return { msg: 'Hello world!', }; }, methods: { getLoginCallback(e) { console.log('登录信息:', e); if (e.detail.errCode === '10004' || e.detail.errCode === '904') { swan.showToast({ title: '用户未登录', icon: 'none', }); return; } swan.showToast({ title: '用户登录成功', icon: 'none', }); }, checkSession() { swan.checkSession({ success: (res) => { swan.showModal({ title: '', content: '用户在小程序中 登录态有效', }); }, fail: (err) => { swan.showModal({ title: '', content: '用户在小程序中登陆态无效,请点击下方按钮重新登录,获取有效SessionKey', }); }, }); }, }, }; </script>
Sorry, something went wrong.
抱歉,漏了一個重要前提,前提是宿主(百度app)未登录
这样?
No branches or pull requests
相关平台
百度小程序
小程序基础库: 3.310.35
使用框架: Vue 2
复现步骤
<button open-type="login" @login="getLoginCallback" @tap="getLoginCallback">授权
发起授权-->允许授权-->获取回调出参,以及回调后调用checksession
期望结果
1、安卓端,正常返回login:ok
2、ios端,checksession返回正常
实际结果
1、安卓端,允许授权后不返回login:ok,但是checksession返回已授权
2、ios端,允许授权后返回login:ok,但是checksession返回session key expired
环境信息
The text was updated successfully, but these errors were encountered: