-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix: 修复支付宝 openLocation API 参数错误 #17547
New issue
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
Conversation
Walkthrough本次更新对 packages/taro-platform-alipay 模块内的两个文件进行了修改。在 Changes
Sequence Diagram(s)sequenceDiagram
participant 客户端
participant Taro平台
客户端->>Taro平台: 调用 openLocation()
Taro平台-->>客户端: 返回 Promise 结果
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/taro-platform-alipay/src/apis.ts (2)
181-183
: 优化链式调用静态分析工具提示可以将此处代码优化为可选链式调用。
可以考虑将:
- return (options.scanType && options.scanType[0].slice(0, -4)) || 'qr' + return (options.scanType?.[0]?.slice(0, -4)) || 'qr'这样可以避免潜在的空引用错误。
🧰 Tools
🪛 Biome (1.9.4)
[error] 182-182: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
367-370
: 优化回调处理和避免使用 delete 操作符静态分析工具提示可以优化回调处理,并避免使用影响性能的 delete 操作符。
可以考虑将:
- res.header = res.headers - delete res.headers - originSuccess && originSuccess(res) + res.header = res.headers + res.headers = undefined + originSuccess?.(res) - originFail && originFail(res) + originFail?.(res) - originComplete && originComplete(res) + originComplete?.(res)这样可以提高代码性能和可读性。
Also applies to: 372-377
🧰 Tools
🪛 Biome (1.9.4)
[error] 367-367: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 369-369: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
tests/__tests__/__snapshots__/mini-platform.spec.ts.snap
is excluded by!**/*.snap
tests/__tests__/__snapshots__/tabbar.spec.ts.snap
is excluded by!**/*.snap
📒 Files selected for processing (2)
packages/taro-platform-alipay/src/apis-list.ts
(1 hunks)packages/taro-platform-alipay/src/apis.ts
(12 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/taro-platform-alipay/src/apis.ts
[error] 182-182: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 367-367: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 369-369: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 369-372: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 374-377: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
🔇 Additional comments (11)
packages/taro-platform-alipay/src/apis-list.ts (1)
44-45
: 支持支付宝 openLocation API Promise 化通过添加 'openLocation' 到 needPromiseApis 集合中,使该 API 能够返回 Promise,从而允许使用 async/await 语法或 then/catch 链式调用,提高代码可读性和可维护性。
packages/taro-platform-alipay/src/apis.ts (10)
16-19
: 代码格式调整:增加尾逗号在对象属性中添加尾逗号,提高了代码的一致性和可维护性。这种格式化调整使得未来的代码变更(增加或删除条目)在 git diff 中更加清晰。
23-29
: 代码格式调整:增加尾逗号在数组内的对象中添加尾逗号,保持了代码风格的一致性。
33-54
: 代码格式调整:增加尾逗号在嵌套的对象和数组结构中添加尾逗号,提高了代码的可读性和一致性。这种调整有助于代码的长期维护。
58-75
: 代码格式调整:增加尾逗号在选项对象中统一添加尾逗号,使得代码格式更加一致。
78-78
: 简单格式调整对 alias 属性值行末增加尾逗号,保持与其它属性格式一致。
Also applies to: 81-81
85-93
: 代码格式调整:增加尾逗号为对象和数组元素添加尾逗号,保持代码格式一致性。
97-103
: 代码格式调整:统一添加尾逗号在 apiDiff 对象的多个属性中统一添加尾逗号,提高代码一致性和可维护性。
Also applies to: 107-113, 117-123, 127-133, 137-143, 146-146, 151-157, 161-167, 172-186, 190-196, 199-199, 202-203, 205-206, 208-209
221-224
: 代码格式调整:asyncResultApiDiff 对象格式统一在 asyncResultApiDiff 对象的各个值函数和数组中添加尾逗号,保持代码格式一致性。
Also applies to: 233-236, 238-239, 246-249, 258-261, 270-273, 282-285, 291-299, 303-311, 318-321, 330-335
337-338
: 完善格式:补充缺失的尾逗号为 getBLEDeviceServices 对象添加尾逗号,使其与其他对象格式保持一致。
341-341
: 函数参数和返回值格式统一为函数定义、对象属性和函数调用等添加尾逗号,使整个代码库的格式更加统一和一致。
Also applies to: 345-346, 349-350, 364-364, 372-372, 377-377, 418-419, 432-434, 440-440, 451-451, 461-461, 466-466, 477-478, 481-482, 492-492, 519-519, 532-532, 538-538, 545-545, 552-552
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17547 +/- ##
=======================================
Coverage 58.37% 58.37%
=======================================
Files 469 469
Lines 27231 27231
Branches 5950 5954 +4
=======================================
Hits 15896 15896
- Misses 9957 9963 +6
+ Partials 1378 1372 -6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
这个 PR 做了什么? (简要描述所做更改)
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit
New Features
Refactor