volantis-x / hexo-theme-volantis

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

fix(plugin): 修复leancloud配置特定appId值导致custom_api_server不生效问题 #861

Closed seepine closed 1 year ago

seepine commented 1 year ago

PR Type

Description

国际版appid时,配置了analytics.leancloud.custom_api_server无效

Others

Colsrch commented 1 year ago

image image

您好,我无法复现您所说的情况。在我的测试结果下,它正确使用了自定义 API Server

seepine commented 1 year ago

image image

您好,我无法复现您所说的情况。在我的测试结果下,它正确使用了自定义 API Server

你appid改成-MdYXbMMI结尾的就不会使用custom_api_server

Colsrch commented 1 year ago

确实,APPID结尾不能保证所有人都和这个不一致,既然如此,直接修改 api_server 的赋值应当更为恰当

var api_server = this.custom_api_server || `https://${ this.app_id.slice(0, 8).toLowerCase() }.api.lncldglobal.com`
seepine commented 1 year ago

确实,APPID结尾不能保证所有人都和这个不一致,既然如此,直接修改 api_server 的赋值应当更为恰当

var api_server = this.custom_api_server || `https://${ this.app_id.slice(0, 8).toLowerCase() }.api.lncldglobal.com`

我不确定那段代码的作者加那个判断的原因所以保留着它,如果确定那个逻辑没用那我直接改掉

Colsrch commented 1 year ago

确实,APPID结尾不能保证所有人都和这个不一致,既然如此,直接修改 api_server 的赋值应当更为恰当

var api_server = this.custom_api_server || `https://${ this.app_id.slice(0, 8).toLowerCase() }.api.lncldglobal.com`

我不确定那段代码的作者加那个判断的原因所以保留着它,如果确定那个逻辑没用那我直接改掉

加这个代码的逻辑应该是因为默认的 Leancloud 应用其他人无法自定义 API 后端,为了避免在使用默认的 Leancloud 应用时,用户使用了自定义 API 后端。不过这种情况应该不可能出现。

seepine commented 1 year ago

已修改,是否有发布版本计划,目前因为此问题接口无法访问custom_api_server,导致国内网络情况下,统计功能无法使用