Files
lanterngamescn b1e3ce7433 M3(批3): 微信分享 + 登录(@tencent/wechat_open_sdk)
依赖:ohpm i @tencent/wechat_open_sdk@1.0.19(feature_capabilities)

T-M3-13 ShareProvider:friendsSharetypeUrlToptitleDescript → SendMessageToWXReq(scene 会话/朋友圈)
        + WXWebpageObject → 回传 sharesuccess{success(2成功/3取消),type(1好友/2朋友圈)}。
        type 2截图/3图片/4视频暂回退网页分享(TODO);微信未安装回 cancel 不卡死
T-M3-14 LoginProvider:accreditlogin("1"=QQ空实现/其他=微信) → SendAuthReq(scope snsapi_userinfo) → 取 code。
        🔴 AppSecret 不入端:code 换 profile 必须服务端,无端点时记录 code+TODO,不推不完整 sharelogin(红线)
WeChatApi 单例:createWXAPI(AppID wxd2bd650e06bdfe58 公开标识) + sendReq + handleWant 路由 onResp
EntryAbility.onCreate/onNewWant → WeChatApi.handleWant(接收微信回调)
module.json5:querySchemes ["weixin"](isWXAppInstalled)

运行期成功前提(已注释说明):微信开放平台注册本 HarmonyOS 应用(bundleName+指纹绑 AppID)、登录 profile 需服务端 code 换取端点。
devecocli build 通过(CompileArkTS 编译微信代码无误)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 19:43:11 +08:00

18 lines
535 B
JSON

{
"name": "feature_capabilities",
"version": "1.0.0",
"description": "能力层:每个原生能力 = 一个 CapabilityProvider 插件",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"dependencies": {
"contracts": "file:../contracts",
"common": "file:../common",
"platform": "file:../platform",
"domain_resource": "file:../domain_resource",
"feature_bridge": "file:../feature_bridge",
"@tencent/wechat_open_sdk": "^1.0.19"
},
"devDependencies": {},
"dynamicDependencies": {}
}