Git Product home page Git Product logo

Comments (8)

lizheming avatar lizheming commented on June 12, 2024 1

@FidStyle 修了,更新到 @waline/[email protected]


@FidStyle fixed it and updated it to @waline/[email protected]

from waline.

lizheming avatar lizheming commented on June 12, 2024
  1. pageview 接口之前是有一个返回数据问题,是当请求一条的时候返回的是 1,而多条的时候返回的是 [1,1] 数组格式。这块在新的版本中已经都统一成了 {errmsg: '', errno: '', data: [1]} 结构体了。前提是需要使用 <serverURL>/api 新的接口来请求。
  2. 我看了下你的 MR BeiyanYunyi/sodesu@8208fae 没有看太明白,我们应该是不会返回{time: 1} 这种结构的。这块建议你直接发下请求地址我一块看看。

  1. The pageview interface had a problem with returning data before. When one request was made, it returned 1, and when multiple requests were made, it returned the [1,1] array format. This has been unified into the {errmsg: '', errno: '', data: [1]} structure in the new version. The premise is that you need to use the <serverURL>/api new interface to request.
  2. I took a look at your MR BeiyanYunyi/sodesu@8208fae. I didn’t understand it very well. We should not return a structure like {time: 1}. It is recommended that you directly send the request address and I will take a look.

from waline.

BeiyanYunyi avatar BeiyanYunyi commented on June 12, 2024

对于“其他页面 pageview”的情况:

GET https://walinejs.comment.lithub.cc/api/article?path=/guide/features/pageview.html,/guide/features/i18n.html&type=time&lang=zh-CN

返回值:

{"errno":0,"errmsg":"","data":[{"time":5995},{"time":4844}]}

对于“本页面 pageview”的情况:

POST https://walinejs.comment.lithub.cc/api/article?lang=zh-CN

返回值:

{"errno":0,"errmsg":"","data":[125849]}

两个返回值的 data 格式很显然是不同的。


For the case of "other page pageview":

GET https://walinejs.comment.lithub.cc/api/article?path=/guide/features/pageview.html,/guide/features/i18n.html&type=time&lang=zh-CN

return value:

{"errno":0,"errmsg":"","data":[{"time":5995},{"time":4844}]}

For the case of "this page pageview":

POST https://walinejs.comment.lithub.cc/api/article?lang=zh-CN

return value:

{"errno":0,"errmsg":"","data":[125849]}

The data format of the two return values ​​is obviously different.

from waline.

Mister-Hope avatar Mister-Hope commented on June 12, 2024

Any update with this @lizheming, dpes client side code need any changes?

from waline.

Mister-Hope avatar Mister-Hope commented on June 12, 2024

@lizheming 我这两天又羊了,正难受,你看一下这个问题是 @waline/api 写的有问题还是的确需要 refine 一下服务端的 api 吧。


@lizheming I've been having trouble these past two days and I'm feeling uncomfortable. Please check if this question is written by @waline/api, or if the server-side API really needs to be refined.

from waline.

lizheming avatar lizheming commented on June 12, 2024

@Mister-Hope 是服务端 API 改造的问题,这个我正在纠结预期的返回格式是什么样子的,确认完之后再统一修改一下。


@Mister-Hope It’s a question of server-side API transformation. I’m struggling with what the expected return format should be. I’ll make unified changes after confirmation.

from waline.

lizheming avatar lizheming commented on June 12, 2024

为了统一 pageview 和 reaction 的返回格式,思考了下,最终统一按照如下结构体进行统一返回。@waline/client@v3 也需要进行下适配,这块我来同步修改一下。

type ResponseData = Counter[];

interface Counter {
  time?: number;
  reaction0: number;
  reaction1: number;
}

In order to unify the return format of pageview and reaction, I thought about it and finally unified the return according to the following structure. @waline/client@v3 also needs to be adapted. I will modify this synchronously.

type ResponseData = Counter[];

interface Counter {
  time?: number;
  reaction0: number;
  reaction1: number;
}

from waline.

FidStyle avatar FidStyle commented on June 12, 2024

image
按照文档配置发生error,仍然无法显示
服务端客户端均为latest
@lizheming

from waline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.