volantis-x / hexo-theme-volantis

A Wonderful Theme for Hexo.
https://volantis.js.org
MIT License
1.98k stars 596 forks source link

【问题】:v6中memos插件请求的api地址有问题 #913

Closed musnows closed 3 months ago

musnows commented 4 months ago

检查清单

主题版本

6.x

复现地址

https://memos.musnow.top/

问题描述

使用的memos v0.19.1,对比sidebar中的memos请求和plugins中的memos请求会发现,sidebar中的请求是对的。

当前所处主题的git hash为:e53eae55a5f00ead3368fc95e87d7ebbe77ff157

sidebar的配置如下

# Memos widget
    memos_carousel:
      class: memos_carousel
      display: [desktop, mobile]
      header:
        icon: fa-solid fa-volume-high
        title: 说说
        url: /memos/ # 说说页面的地址
      url: 'https://memos.musnow.top/' # 替换城自己的域名,也可以用杜老师的平台托管
      limit: '10' # 展示数量限制
      creatorId: '1' # 替换成自己的用户的ID
      tag: '' # 要展示的内容的标签
      image: 'fa-solid fa-image' # 图片替换成图标
      link: 'fa-solid fa-link' # 链接替换成图标
      placeholder: '说说加载中...' # 占位符

最终请求的地址是

https://memos.musnow.top/api/v1/memo?creatorId=1&tag=&limit=10

plugins的配置如下

  # Memos https://usememos.com
  memos:
    # Set `plugins: ["memos"]` to enable in front-matter
    url: 'https://memos.musnow.top/' # 替换成自己的域名,也可以用杜老师的平台托管
    limit: '10' # 展示数量限制
    id: '1' # 替换成自己的用户的ID

最终请求的地址是

https://memos.musnow.top/api/memo?creatorId=1&rowStatus=NORMAL&limit=10

这里plugins的请求是404的,因为请求路径中少了一个/v1/

image

image

加上v1后可以正常访问结果。

image

配置文件

站点配置文件

上文已经提供

环境信息

node.js & npm

``` node v16.20.2 npm 8.19.4 ```

package.json

``` hexo-site@0.0.0 D:\HEXO\test ├── hexo-generator-archive@1.0.0 ├── hexo-generator-category@1.0.0 ├── hexo-generator-index@2.0.0 ├── hexo-generator-tag@1.0.0 ├── hexo-renderer-ejs@2.0.0 ├── hexo-renderer-marked@5.0.0 ├── hexo-renderer-stylus@2.1.0 ├── hexo-server@3.0.0 └── hexo@5.4.2 ```

inkss commented 3 months ago

@penndu 这里引用的都是你那边的代码,来看看。

https://github.com/volantis-x/hexo-theme-volantis/blob/fa1e66679875e986427631c7411f790b1fd18f0d/layout/_plugins/_page_plugins/memos/index.ejs#L1-L15

https://github.com/volantis-x/hexo-theme-volantis/blob/fa1e66679875e986427631c7411f790b1fd18f0d/layout/_widget/memos_carousel.ejs#L1-L22

penndu commented 3 months ago

@penndu 这里引用的都是你那边的代码,来看看。

https://github.com/volantis-x/hexo-theme-volantis/blob/fa1e66679875e986427631c7411f790b1fd18f0d/layout/_plugins/_page_plugins/memos/index.ejs#L1-L15

https://github.com/volantis-x/hexo-theme-volantis/blob/fa1e66679875e986427631c7411f790b1fd18f0d/layout/_widget/memos_carousel.ejs#L1-L22

亲测可用!

github-actions[bot] commented 3 months ago

:wave: Hello, Due to the design or external issues, we will not deal with this, but we still appreciate your feedback.

:wave: 您好, 由于设计如此,或者是外界问题导致,我们不会对此进行处理,但仍然感谢您的反馈!