Skip to content

dangerousRemoteDomainIpcAccess 不适用于IP地址,临时解决方案 #573

Answered by iFTY-R
iFTY-R asked this question in Q&A
Discussion options

You must be logged in to vote

找到一个临时解决方案:

修改依赖包的源代码
找到
C:\Users%USER_HOME%.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-1.4.1\src\scope\ipc.rs

修改 函数 remote_access_for

将 155 行中的 matches_domain 删除掉,去掉校验

if matches_window && matches_domain && scope.is_none() {
        scope.replace(s.clone());
}

改成

if matches_window && scope.is_none() {
        scope.replace(s.clone());
}

可以临时用来解决这个问题

最后记得删除 项目中的 src-tauri/target 文件夹,重新调试或者打包即可

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tw93
Comment options

Answer selected by tw93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants