gitment icon indicating copy to clipboard operation
gitment copied to clipboard

现在是不是不能使用了, 我登入你的博客都提示下面的错误

Open liuyunzhuge opened this issue 5 years ago • 12 comments

企业微信截图_20190606113234 企业微信截图_20190606113325

liuyunzhuge avatar Jun 06 '19 03:06 liuyunzhuge

已复现,我已经换到使用Gitalk

AlotOfBlahaj avatar Jun 08 '19 09:06 AlotOfBlahaj

在其他issue看过这个,可以用这里的js,oauth用的github的:https://yajunw.com/2019/09/08/hexo/

<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"/>

yajw avatar Sep 11 '19 08:09 yajw

<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"/>

老哥,这是改哪里啊,是 post.swig

racla avatar Sep 12 '19 07:09 racla

racla avatar Sep 12 '19 07:09 racla

<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"/>

老哥,这是改哪里啊,是 post.swig

I think it's themes/next/layout/_third-party/comments/gitment.swig, you can also set mint to false of field gitment in themes/next/_config.yml which have the same effect.

Frost-Lee avatar Oct 14 '19 20:10 Frost-Lee

在其他issue看过这个,可以用这里的js,oauth用的github的:https://yajunw.com/2019/09/08/hexo/

<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"/>

此番操作有用,可以初始化了。

ranying666 avatar Oct 27 '19 07:10 ranying666

在其他issue看过这个,可以用这里的js,oauth用的github的:https://yajunw.com/2019/09/08/hexo/

<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"/>

亲测有效,直接替换掉原来的js文件,css文件不用动,多谢! It works, I replace the js file directly, without changing the css file, thanks very much !

wqw547243068 avatar Jan 14 '20 09:01 wqw547243068

在其他issue看过这个,可以用这里的js,oauth用的github的:https://yajunw.com/2019/09/08/hexo/

<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"/>

亲测有效,直接替换掉原来的js文件,css文件不用动,多谢! It works, I replace the js file directly, without changing the css file, thanks very much !

我的错误提示是跨域: (index):1 Access to XMLHttpRequest at 'https://api.github.com/repos/sweetink/sweetink.github.io/issues' from origin 'https://githuboy.online' has been blocked by CORS policy: Request header field accept is not allowed by Access-Control-Allow-Headers in preflight response. gitmint.browser.js:3918 POST https://api.github.com/repos/sweetink/sweetink.github.io/issues net::ERR_FAILED

SweetInk avatar Apr 30 '20 11:04 SweetInk

Nice Updated! https://www.tentdepot.ca/

tentdepot avatar Oct 12 '20 08:10 tentdepot

修改gitment.browser.js文件的3416行将https://gh-oauth.imsun.net/替换成:https://baifachuan.com:8443/

该服务器代码在:https://github.com/imsun/gh-oauth-server,不会记录任何信息,我也是自己的博客使用:https:www.baifachuan.com,因为该服务器需要https,所以构建在自己的服务下,需要的可以使用。修改后的代码为:

      _utils.http.post('https://www.baifachuan.com:8443', {
        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);
      });
    } else {
      this.update();
    }

update the gitment.browser.js file replace https://gh-oauth.imsun.net/ to https://baifachuan.com:8443/. This service won't record or store anything. It only attaches a CORS header to that request and provides proxy. So that users can login in the frontend without any server-side implementation.

baifachuan avatar Nov 30 '21 13:11 baifachuan

Your article is very useful, the content is great, I have read a lot of articles, but for your article, it left me a deep impression, thank you for sharing. https://www.brandedcanopytents.com/

Brandedcanopytent avatar Mar 09 '22 15:03 Brandedcanopytent