释义搜索改为跳转百度百科词条

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 22:35:44 +08:00
parent 945e71dfa7
commit d6e75eaede
@@ -188,9 +188,8 @@ final class WordDetailViewController: UIViewController {
private func searchMeaning() { private func searchMeaning() {
Haptics.selection() Haptics.selection()
let text = "\(word.word) 是什么意思" guard let encoded = word.meaning.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed),
guard let query = text.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed), let url = URL(string: "https://baike.baidu.com/item/\(encoded)") else { return }
let url = URL(string: "https://www.google.com/search?q=\(query)") else { return }
present(SFSafariViewController(url: url), animated: true) present(SFSafariViewController(url: url), animated: true)
} }