| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /**
- * 登录参数
- */
- export type GoogleLoginOptions = {
- serverClientId:string
- success ?: (res : GoogleLoginSuccess) => void
- fail ?: (res : GoogleLoginFail) => void
- complete ?: (res : any) => void
- }
- /**
- * 登出参数
- */
- export type GoogleLogoutOptions = {
- success ?: (res : any) => void
- fail ?: (res : GoogleLoginFail) => void
- complete ?: (res : any) => void
- }
- export type GoogleLoginSuccess = {
- headimgurl : string|null,
- nickname : string|null,
- email : string|null,
- openId : string,
- idToken : string,
- }
- /**
- * 错误码
- * 根据uni错误码规范要求,建议错误码以90开头,以下是错误码示例:
- * - 9010001 不具备登录的系统环境,比如当前所在的activity状态异常
- * - 9010002 用户参数配置错误,重点检查serverClientId/包名/签名是否正确
- * - 9010003 暂不支持的登录凭证
- * - 9010004 签名错误
- * - 9010005 缺少系统组件,比如GMS
- * - 9010099 其他未知错误
- */
- export type GoogleLoginErrorCode = 9010001 | 9010002 | 9010003 | 9010004 | 9010005 | 9010099;
- /**
- * 登录过程中发生错误
- */
- export interface GoogleLoginFail extends IUniError {
- errCode : GoogleLoginErrorCode
- };
- /**
- * 实现登录
- */
- export type GoogleLogin = (options : GoogleLoginOptions) => void
- /**
- * 取消登录
- */
- export type GoogleLogout = (options : GoogleLogoutOptions) => void
|