diff --git a/ohos/src/libs/QQOpenSdk.har b/ohos/src/libs/QQOpenSdk.har index d3a083b..e56bbc8 100644 Binary files a/ohos/src/libs/QQOpenSdk.har and b/ohos/src/libs/QQOpenSdk.har differ diff --git a/ohos/src/main/ets/components/plugin/TencentKitPlugin.ets b/ohos/src/main/ets/components/plugin/TencentKitPlugin.ets index a5a316a..448021e 100644 --- a/ohos/src/main/ets/components/plugin/TencentKitPlugin.ets +++ b/ohos/src/main/ets/components/plugin/TencentKitPlugin.ets @@ -57,7 +57,7 @@ export default class TencentKitPlugin implements FlutterPlugin, MethodCallHandle } onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void { - this.tencent?.handleAuthResult(want) + this.tencent?.handleResult(want) } authListener: ApiCallback = { @@ -66,7 +66,7 @@ export default class TencentKitPlugin implements FlutterPlugin, MethodCallHandle try { if (response.ret == TencentRetCode.RET_SUCCESS) { // 服务端模式时, access_token 设置为为 authCode, 当前 SDK 不支持客户端模式(因此 null) - const accessToken: string | null = this.modeServerSide ? response.authCode : null; + const accessToken: string = response.authCode; resp.set(KEY_RET_CODE, TencentRetCode.RET_SUCCESS); resp.set("openid", response.openId); resp.set("access_token", accessToken); @@ -141,6 +141,12 @@ export default class TencentKitPlugin implements FlutterPlugin, MethodCallHandle private login(call: MethodCall, result: MethodResult) { // this.modeServerSide = false; // 客户端授权 // 当前 SDK 仅支持 ServerSide 授权,暂时不处理 + this.tencent?.login({ + scope: "all", + useQrCode: false, + networkTimeout: 0, + forceWebLogin: false + }, this.authListener); result.success(null); } @@ -148,7 +154,7 @@ export default class TencentKitPlugin implements FlutterPlugin, MethodCallHandle this.modeServerSide = true; // 服务端授权 const scope: string = call.argument("scope"); const qrcode: boolean = call.argument("qrcode"); - this.tencent?.login(this.getUIContext(), { + this.tencent?.login({ scope: scope, useQrCode: qrcode, forceWebLogin: qrcode || !this.tencent!.isQQInstalled(), // H5 授权, 二维码登录或 QQ 未安装时强制启用