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

对接后端 v5 API #204

Open
TechQuery opened this issue Nov 27, 2023 · 3 comments · May be fixed by #209
Open

对接后端 v5 API #204

TechQuery opened this issue Nov 27, 2023 · 3 comments · May be fixed by #209
Assignees
Labels
feature New feature or request

Comments

@TechQuery
Copy link
Member

TechQuery commented Nov 27, 2023

核心需求

后端接口封装包 mobx-restful 替换为 mobx-strapi

接口文档

https://hackathon-server.kaiyuanshe.cn/documentation

@TechQuery TechQuery created this issue from a note in 开放黑客松平台 v2 (To do) Nov 27, 2023
@TechQuery TechQuery added the feature New feature or request label Nov 27, 2023
@TechQuery TechQuery removed this from To do in 开放黑客松平台 v2 Nov 28, 2023
@luojiyin1987
Copy link

luojiyin1987 commented Dec 22, 2023

mobx-restful-tablemobx-restful 是否有依赖关系? mobx-strapi 是否可以直接替换 ?

image

@TechQuery
Copy link
Member Author

TechQuery commented Dec 22, 2023

mobx-restful-tablemobx-restful 是否有依赖关系? mobx-strapi 是否可以直接替换 ?

  1. peerDependencies 关系
  2. 可,但需要修改接口路径、数据类型

@TechQuery
Copy link
Member Author

TechQuery commented Dec 23, 2023

我在 #207 已把 Strapi API 的 HTTP 客户端接好,可直接引用:

export const strapiClient = new HTTPClient({
baseURI: `${
process.env.NODE_ENV === 'development'
? 'http://127.0.0.1:1337'
: 'https://hackathon-server.kaiyuanshe.cn'
}/api/`,
responseType: 'json',
}).use(({ request }, next) => {
if (token)
request.headers = { ...request.headers, Authorization: `Bearer ${token}` };
return next();
});

@luojiyin1987 luojiyin1987 self-assigned this Jan 13, 2024
@luojiyin1987 luojiyin1987 linked a pull request Feb 22, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

2 participants