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

API 接口 stats/site_pv 响应数据格式错误 #896

Closed
white0dew opened this issue May 28, 2024 · 3 comments
Closed

API 接口 stats/site_pv 响应数据格式错误 #896

white0dew opened this issue May 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@white0dew
Copy link

          你好,这个功能已经存在了,GET 请求 `https://artalk.xxx.com/api/v2/stats/site_comment?site_name=站点名` 可以得到 `{"data":957}`
const siteName = '站点名'; // 替换为实际的站点名
const url = `https://artalk.xxx.com/api/v2/stats/site_comment?site_name=${encodeURIComponent(siteName)}`;

fetch(url)
  .then(response => {
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    return response.json();
  })
  .then(({ data }) => {
    console.log(data); // 输出获取的数据
  })
  .catch(error => {
    console.error('There was a problem with the fetch operation:', error);
  });

https://artalk.js.org/http-api.html#tag/Statistic/operation/GetStats

Originally posted by @qwqcode in #811 (comment)

site_pv 经测试,无法使用?请问是什么原因呢

@jerryc127
Copy link

https://artalk.xxx.com/api/v2/stats/site_comment?site_name=站点名

這個也不是獲取 site_pv 啊

@white0dew
Copy link
Author

https://artalk.xxx.com/api/v2/stats/site_comment?site_name=站点名

這個也不是獲取 site_pv 啊

我是指,将原本的site_comment换成site_pv,获取的数据是undefined

@qwqcode qwqcode changed the title 你好,这个功能已经存在了,GET 请求 https://artalk.xxx.com/api/v2/stats/site_comment?site_name=站点名 可以得到 {"data":957} API 接口 stats/site_pv 响应数据格式错误 May 29, 2024
@qwqcode qwqcode added the bug Something isn't working label May 29, 2024
@qwqcode
Copy link
Member

qwqcode commented May 29, 2024

@qwqcode qwqcode closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants