-
Notifications
You must be signed in to change notification settings - Fork 411
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
[BUG] 使用Safari 13浏览器访问时接口报错的调试过程 #531
Labels
bug
Something isn't working
Comments
这。。。。怎么兼容啥的再说,但本质上我觉得这应该属于safari的bug。Proxy可以使用spread运算符,正常执行get逻辑取值。 不过这个调试要给大大的赞👍! |
我测试了一下,
代码这样改可以正常请求数据: fetchCommentList({
...Object.assign({}, config.value),
page: pageNumber,
signal,
}) 搜了一下代码,用到 src/composables/config.ts
24: options = { ...options, ...newOptions };
src/Waline.vue
101: ...Object.assign({}, config.value),
108: data.value.push(...resp.data);
src/utils/emoji.ts
52: ...emojiInfo,
src/utils/config.ts
73: ...more
93: ...$locale,
94: ...(typeof locale === 'object' ? locale : {}),
122: ...more,
src/components/CommentBox.vue
533: setUserInfo({ ...userInfo.value, ...data }); |
好的感谢,回头我更正一下 |
A little bit busy these days, but I will try to fix this tonight. |
Thanks. |
Mister-Hope
added a commit
that referenced
this issue
Sep 20, 2021
A PR is created, but I can not test if it's working. ( It should work though) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
之前我在Safari 13浏览器使用waline时发现获取评论列表的接口出错了,访问了:
最近我在本地运行了waline,大概找到了bug产生的原因,下面说一下查找bug的过程以供参考。
首先在js代码里搜索关键字
comment
,找到了请求评论列表的代码,可以发现传进来的变量基本为undefined
:在代码调用堆栈往回找,发现有些变量是通过
...config.value
传进来的:在控制台打印一下结果,发现使用
...
操作符得到的是空字典:而在Chrome浏览器打印结果,得到的字典是有值的:
猜想Safari浏览器使用
...
语法会有问题,但是测试了以下语句又是正常的:所以,问题很可能出在
config.value
身上,config.value
的类型是Proxy
,在网上搜了一下发现是Vue
的类,猜想对这个类进行...
操作可能有问题。而在调试的过程中,我发现
config
还有一个_rawValue
的属性,应该是value
的原始数据:打印一下结果,发现字典有值了:
然后我修改了一下
Waline.vue
文件里这个方法:刷新网页后,请求评论的接口正常了:
在Chrome试了一下也是OK的。
但是我没学过
Vue
,所以不知道这样修改会不会有问题,还是有更好的修改方法?The text was updated successfully, but these errors were encountered: