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

[object ProgressEvent] #170

Closed
haig233 opened this issue Sep 16, 2018 · 53 comments
Closed

[object ProgressEvent] #170

haig233 opened this issue Sep 16, 2018 · 53 comments

Comments

@haig233
Copy link

haig233 commented Sep 16, 2018

现在全网的gitment登录都报[object ProgressEvent] 错误
希望作者能修复

@w568w
Copy link

w568w commented Sep 16, 2018

这似乎是个间断出现的错误,我自己的网页每次登录都有1/3的几率报这个错误...

P.S.:作者好像已经弃坑了

@SeasideLee
Copy link

看起来作者提供给使用者的加 CORS header 的服务已经停了,如果想继续使用我们就得自己搭一个这样的服务,不过作者已经把这个开源了,很简单的 nodejs 代码,项目地址

@haig233
Copy link
Author

haig233 commented Sep 17, 2018

@SeasideLee 这个怎么弄的啊
方便发下教程吗?

@shlyren
Copy link

shlyren commented Sep 17, 2018

我临时搭了个服务器 把https://imsun.github.io/gitment/dist/gitment.browser.js 内 这个 https://gh-oauth.imsun.net 验证api换成https://auth.baixiaotu.cc

@haig233
Copy link
Author

haig233 commented Sep 17, 2018

@shlyren 搭建自己的服务器让他跑吗?

@haig233
Copy link
Author

haig233 commented Sep 17, 2018

关键我这个主题把gitment集成在里面,关键的配置文件和代码在哪我都还要一个个去找

@shlyren
Copy link

shlyren commented Sep 17, 2018

@haig233 全局搜https://gh-oauth.imsun.net/ 应该能找到gitment的js文件

@haig233
Copy link
Author

haig233 commented Sep 17, 2018

@shlyren 换成你的服务器?

@shlyren
Copy link

shlyren commented Sep 17, 2018

@haig233 你可以自己搭建, 我是搭建自己用的, 以后很可能换地址什么的

@haig233
Copy link
Author

haig233 commented Sep 17, 2018

@shlyren 方便写个搭建教程吗?

@haig233
Copy link
Author

haig233 commented Sep 17, 2018

我是萌新站长,不懂那么多

@shlyren
Copy link

shlyren commented Sep 17, 2018

@haig233 服务器源代码在这https://github.com/imsun/gh-oauth-server ,由于是nodejs写的所以需要安装nodejs环境 如何安装自己Google; 然后git clone 该项目并进入目录, 执行npm install 安装依赖, 依赖安装成功后执行npm start, 如果输出start on port 300表示开启成功,;为了支持ssl 可以安装nginx代理, 这个可以自己百度, 有很多教程的

@marvincreat
Copy link

试了下@shlyren @SeasideLee 的方法,可行,就是http好像还是会报错,https就可以了

@shlyren
Copy link

shlyren commented Sep 18, 2018

估计是证书到期导致

@fengzean
Copy link

这个证书签发时间有点短吧

@shlyren
Copy link

shlyren commented Sep 19, 2018

@fengzean 作者这个证书是免费的 只有90天, 不过可以通过脚本自动续签, 作者应该没有自动续签

@MegaShow
Copy link

对不起,给各位大佬添麻烦了。
本人在别人的issue里面发了这个issue的链接,然后发现居然自动创建了一个引用。(真不知道

(搜索的结果都是不可删除,怕是真的删除不了了
请大家忽视这个引用吧,给大家添麻烦了~

@jjeejj
Copy link

jjeejj commented Sep 19, 2018

由于引入的 gitment.js 中有这样的一段代码:

     _utils.http.post('https://gh-oauth.imsun.net', {
        code: code,
        client_id: client_id,
        client_secret: client_secret
      }, '').then(function (data) {
        _this.accessToken = data.access_token;
        _this.update();
      }).catch(function (e) {
        _this.state.user.isLoggingIn = false;
        alert(e);
      });

请求了一个服务接口,由于这个服务接口是作者自己搭建的,已经停止了。
这里可以直接改为请求 github 认证的接口
_utils.http.post('https://github.com/login/oauth/access_token', {...}

就可以了,不用经过作者的服务

@shlyren
Copy link

shlyren commented Sep 20, 2018

@jjeejj 直接用GitHub认证的接口https://github.com/login/oauth/access_token 登陆一直转菊花

@jjeejj
Copy link

jjeejj commented Sep 20, 2018

@shlyren 嗯 对的, 会存在跨域的问题,还是得有个后台服务,转发这个跨域的请求

@RogerDTZ
Copy link

同样出现这种情况
但不是永远无效
我等了一会之后又可以使用了
然而换一个浏览器登录又出现了这个问题
=_=

@xiaotiandi
Copy link

可参考: https://xiaotiandi.github.io/publicBlog/2018-09-19-d196c9ad.html

@jjeejj 的方案可行

@jjeejj
Copy link

jjeejj commented Sep 23, 2018

我自己搭建了 一个通用的跨域服务,可以解决这个问题。 具体可以看 https://www.wenjunjiang.win/2017/07/02/gitment%E8%AF%84%E8%AE%BA%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%85%A5hexo/

@iHTCboy
Copy link

iHTCboy commented Oct 7, 2018

@shlyren 感谢!我现在使用你的 https://auth.baixiaotu.cc 来授权啊,现在正常使用啊~

@noobfish
Copy link

oh no

@SmalBox
Copy link

SmalBox commented Oct 25, 2018

@shlyren 感谢给出解决办法。根据你的提示,我自己搭了一个服务器,一切运行正常.

有需要的小伙伴,可以来用 https://bak.smalbox.club

我写了一个详细的搭建过程,想自己搭建的可以来做个参考。帖子在这里

@shlyren
Copy link

shlyren commented Dec 6, 2018 via email

@AboutSange
Copy link

我自己搭建了 一个通用的跨域服务,可以解决这个问题。 具体可以看 https://www.wenjunjiang.win/2017/07/02/gitment%E8%AF%84%E8%AE%BA%E6%A8%A1%E5%9D%97%E6%8E%A5%E5%85%A5hexo/

  1. 修改文件themes\next\layout_third-party\comments\gitment.swig:
    https://imsun.github.io/gitment/style/default.css 修改为 https://www.wenjunjiang.win/css/gitment.css
    https://imsun.github.io/gitment/dist/gitment.browser.js 修改为 https://www.wenjunjiang.win/js/gitment.js

  2. 修改文件themes\next_config.yml:
    gitment下的mint修改为false

3.重启服务器就可以了

感谢大佬!!!

@iHTCboy
Copy link

iHTCboy commented Dec 31, 2018

@shlyren 你的这个 https://auth.baixiaotu.cc 服务器链接已经不能使用了😭

@shlyren
Copy link

shlyren commented Jan 2, 2019

@iHTCboy 实在不好意思, 之前服务器重启就忘记开启了, 现在已经可以了

@DMCzero
Copy link

DMCzero commented Jan 13, 2019

如果是换了post也不行,试试将gitment.ejs的script src项,改成https://jjeejj.github.io/js/gitment.js或者https://www.wenjunjiang.win/js/gitment.js

@stevenjoezhang
Copy link

stevenjoezhang commented Jan 13, 2019

也可以使用这个:

<script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.css"/>

建议转gitalk,可以兼容之前gitment的评论。

@sherry0429
Copy link

还有问题的可以看下教程:
https://sherry0429.github.io/2019/02/12/gitment%E4%BF%AE%E5%A4%8D/

我这边自己参考楼上的各位大佬做了一遍,主要就是建立服务器,修改gitment中的browser.js并上传至一个某个oss或静态文件服务器,在引用gitment对应js的地方替换为自己上传的js。

上述的博客是可以评论的(用的就是gitment),有问题可以交流

@marvincreat
Copy link

自己搭建服务器解决方案可以参考这篇文章,完整讲述如何部署nodejs项目到阿里云ECS服务器上,
阿里云ECS服务器部署Node.js项目全过程详解

@monkey-wenjun
Copy link

可以参考 https://awen.me/post/64465.html 文档说明配置。

@wzxJayce
Copy link

wzxJayce commented Mar 22, 2019

主要是作者的这个仓库不提供default.css和itment.browser.js,导致读取这两个链接的时候出错

🍉 :

解决
打开你的blog本地仓库themes\yilia\layout_partial\post\gitment.ejs将

<link rel="stylesheet" href="//imsun.github.io/gitment/style/default.css">
<script src="//imsun.github.io/gitment/dist/gitment.browser.js"></script>

修改为:

<link rel="stylesheet" href="https://wzxjayce.github.io/gitment.css">
<script src="https://wzxjayce.github.io/gitment.js"></script>

[参考链接](https://blog.csdn.net/wardseptember/article/details/82828391)

@zhuiyue132
Copy link

zhuiyue132 commented Apr 24, 2019

目前撸了一个 PHP 的实现:https://gh-oauth.openapi.link,如果需要自己搭建的话可以参考:isecret/gh-oauth-server

目前用的是您的服务,如果您有变动,还请告知一下。@isecret

@lmlmkp
Copy link

lmlmkp commented May 5, 2019

目前撸了一个PHP的实现:https://gh-oauth.openapi.link,如果需要自己搭建的话可以参考:isecret / gh-oauth-server

目前用的是你的服务,如果您有变动,还请告知一下。@isecret

我也用的这个,千万别崩啊

@Chiang97912
Copy link

Chiang97912 commented Aug 1, 2019

目前网上大部分解决方案都失效了,可以使用下面的方法解决:
打开你的blog本地仓库themes\next\layout_third-party\comments\gitment.ejs将

<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>

修改为:

<link rel="stylesheet" href="https://billts.site/extra_css/gitment.css">
<script src="https://billts.site/js/gitment.js"></script>

上面给出的是gitment汉化版

@crazymen-nanke
Copy link

teet

@lipeng1667
Copy link

@Chiang97912 亲测可用,不过确实是汉化版的,有没有原版的地址?thx~

@Chiang97912
Copy link

Chiang97912 commented Aug 21, 2019

测试了网上一些英文版基本都失效了,暂时只知道这个汉化版可以使用。

@Chiang97912 亲测可用,不过确实是汉化版的,有没有原版的地址?thx~

@iHTCboy
Copy link

iHTCboy commented Feb 13, 2022

【弃坑,转 GitTalk】

方法:把 gitment 转为 GitTalk ,只需要修改 gitment.ejs 文件:

<div id="gitment-ctn"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script>
var gitalk = new Gitalk({
  clientID: 'xxxxx', //Client ID

  clientSecret: 'xxxx', //Client Secret

  repo: 'newban_comment',//仓库名称
  owner: 'iHTCboy',//仓库拥有者
  admin: ['iHTCboy'],
  id: location.href,      // Ensure uniqueness and length less than 50
  distractionFreeMode: false  // Facebook-like distraction free mode
})
gitalk.render('gitment-ctn')
</script>

其中的参数可以用配置文件的值:

  clientID: '<%=theme.gitment_oauth.client_id%>',
  clientSecret: '<%=theme.gitment_oauth.client_secret%>',

  repo: '<%=theme.gitment_repo%>',
  owner: '<%=theme.gitment_owner%>',

最后,如果需要迁移原评论,需要在 issues 中添加 label 标签 “Gitalk” 才能识别原有的评论。

文件参考:https://github.com/iHTCboy/hexo-theme-yilia/blob/master/layout/_partial/post/gitment.ejs

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