Skip to content
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

运行效果跟预期的不太一样,是不是我打开方式不对? #14

Closed
fatesinger opened this issue Jul 30, 2017 · 6 comments
Closed

Comments

@fatesinger
Copy link

fatesinger commented Jul 30, 2017

:)

  1. 代码部署好以后,打开文章页面有时候需要刷新才显示内容,不知道为何。

  2. 点赞和评论提示失败 ,但是刷新会显示

{
    code: 1,
    message: "爱你么么扎",
    result: null
}
{
    code: 1,
    message: "评论发布成功",
    result: ...
}
  1. 文章提交后没有做XSS攻击,可以在文章中添加JavaScript代码,不过个人博客也无关紧要。(很多种解决办法,例如js-xss)

  2. 后台的提示信息不会自动消失

演示地址:戳这里

注:NodeJs v- 8.2.1

最后说下,我正准备写这样一个博客,今天刚建好仓库,就发现了你的项目,话说这个项目写了多久。

@surmon-china
Copy link
Owner

surmon-china commented Jul 30, 2017

  1. http2 协议引起的,具体什么原因不知道,搞定了麻烦告诉我~
  2. 不清楚,建议你在服务端断点调试,极有可能是针对了域名来源做过滤引起的,而你没有修改
  3. 对于评论,xss是有过滤的,对于博主,文章包含脚本代码是需求。
  4. 啥?

可能陆陆续续半年多吧,看 commit 记录挺久的

@fatesinger
Copy link
Author

貌似跟h2关系不大,在Firefox / IE 中测试没问题,Chrome / Edge 中会这样
测试请求发现,所有的response结果在chrome中是这样的

{
    ...
    status: 200
    statusText: ""
}

statusText 值为空, Firefox中值为“OK”
所以在判断success时为false
改成 Object.is(response.status, 200) 问题解决

  • 至于刷新数据才显示,不知道原因。

上面说的那个4 是后台的提示信息

tim 20170801005312

貌似跟没填写qiniu账号有关,还没找原因。

@surmon-china
Copy link
Owner

1我下午修复了,确实是你说的原因,所以现在改判断status是否有效了,还是h2/1.1在chrome下表现不一致导致的。按理说如果修复了,“刷新才显示”这个bug应该就不存在了才对。

后台那个项目,我好久没更新了,不知道是什么问题,也不打算继续维护了,只要能用就可以,弹出的消息是依赖了一个ngx的组件,你可以看下是否是组件你的更新导致的

@fatesinger
Copy link
Author

是的,bug 不存在了,当时没明白为什么会这样
后台提示信息也可以了,版本问题导致 moxie defined
Thanks

@surmon-china
Copy link
Owner

surmon-china commented Aug 2, 2017

因为 SSR 同构,在服务端请求时 axios 用的是 http(具体是啥我也不知道)模块,不存在客户端的字段偏差, 所以一定能渲染成功。

@fatesinger
Copy link
Author

之前没太搞懂SSR机制,明白了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants