Skip to content

Conversation

@luojiyin1987
Copy link
Contributor

@luojiyin1987 luojiyin1987 commented Feb 22, 2024

Checklist(清单):

  • Labels
  • Assignees
  • Reviewers

Closes #204

@luojiyin1987 luojiyin1987 self-assigned this Feb 22, 2024
Copy link
Contributor

@TechQuery TechQuery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请把整个项目运行起来,看看控制台有没有任何网络接口报错、在后台添加的数据前台能不能显示出来。


export class AwardModel extends Stream<Award>(ListModel) {
client = sessionStore.client;
export class AwardModel extends Stream<Award>(StrapiListModel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export class AwardModel extends Stream<Award>(StrapiListModel) {
export class AwardModel extends StrapiListModel<Award> {

Strapi 有能定位到具体页数的分页参数,不需要 Stream 流式加载。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看不懂上面的两次修改

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看不懂上面的两次修改

以前是附加流式加载特性,需要用 mixin(混入)的写法,也就是单继承语言实现多继承。

但 Strapi 不需要流式加载,就直接继承基类即可。

}

export class AwardModel extends Stream<Award>(ListModel) {
client = sessionStore.client;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处不要改动,已经配置好登录验证机制的 API 客户端就是放在这个 store 上的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这我也看不懂了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这我也看不懂了

先说说你个人的理解。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来25 26 行代码是否要改动? 我已经迷糊了。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来25 26 行代码是否要改动? 我已经迷糊了。

Screenshot_2024-05-22-21-41-41-623_com.github.android-edit.jpg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在遇到 类型“AwardModel”上不存在属性“baseURI 的报错

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处不要改动,已经配置好登录验证机制的 API 客户端就是放在这个 store 上的。

关于 client 的问题是我昏头了,你改为 strapiClient 是对的,是我在迁移阶段还没把 client 移到 sessionStore 上。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在遇到 类型“AwardModel”上不存在属性“baseURI 的报错

非流式加载的列表必须声明对应数据结构 API 根路径:
image

参考:https://github.com/idea2app/MobX-RESTful/tree/main/wrapper/Strapi#modelarticlets

@TechQuery
Copy link
Contributor

No more Strapi for Back-end API.

@TechQuery TechQuery closed this Apr 3, 2025
@luojiyin1987
Copy link
Contributor Author

那换成什么? @TechQuery

@TechQuery
Copy link
Contributor

那换成什么? @TechQuery

已经换了,换成上游库:#213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

对接后端 v5 API

3 participants