从 cloudbase js sdk v1 迁移
登录认证
从 v1 到 v2,登录认证模块有以下变化:
- 登录状态持久化:登录状态只支持
local
模式 - v2 版本不再支持监听用户登录状态改变
- 用户字段信息精简化,详见 User
- 对账户关联使用方式进行了调整,并且不再支持关联自定义登录,详见「登录鉴权 v2|账户关联」
- 对登录的使用方式进行了调整,详见「登录鉴权 v2|登录认证」
接口调整
Auth
更新
- 接口命名 typo 修正:不再使用
Auth.getCurrenUser()
,请使用Auth.getCurrentUser()
新增
- Auth.bindEmail
- Auth.bindPhoneNumber
- Auth.bindWithProvider
- Auth.deleteMe
- Auth.genProviderRedirectUri
- Auth.getAccessToken
- Auth.getProviders
- Auth.getUserInfo
- Auth.getVerification
- Auth.grantProviderToken
- Auth.loginScope
- Auth.queryUser
- Auth.resetPassword
- Auth.setCustomSignFunc
- Auth.setPassword
- Auth.signIn
- Auth.signInAnonymously
- Auth.signInWithCustomTicket
- Auth.signInWithOpenId
- Auth.signInWithPhoneAuth
- Auth.signInWithProvider
- Auth.signInWithSms
- Auth.signInWithUnionId
- Auth.signUp
- Auth.sudo
- Auth.unbindProvider
- Auth.verify
废弃
- Auth.anonymousAuthProvider
- Auth.customAuthProvider
- Auth.forceResetPwdByPhoneCode
- Auth.getAuthHeader
- Auth.getAuthHeaderAsync
- Auth.onAccessTokenRefreshed
- Auth.onAnonymousConverted
- Auth.onLoginStateExpired
- Auth.onLoginTypeChanged
- Auth.sendPasswordResetEmail
- Auth.sendPhoneCode
- Auth.shouldRefreshAccessToken
- Auth.signInWithEmailAndPassword
- Auth.signInWithPhoneCodeOrPassword
- Auth.signInWithUsernameAndPassword
- Auth.signUpWithEmailAndPassword
- Auth.signUpWithPhoneCode
- Auth.weixinAuthProvider
LoginState
废弃
- LoginState.isAnonymousAuth
- LoginState.isCustomAuth
- LoginState.isUsernameAuth
- LoginState.isWeixinAuth
- LoginState.loginType
User
废弃
- User.avatarUrl
- User.linkWithPhoneNumber
- User.nickName
- User.updateEmail
- User.updatePassword
- User.updatePhoneNumber
- User.updateUsername