Github 和 Gitee API 接入
正在加载今日诗词....2022-04-29
Github API 接入
接入流程:
创建 SSH 帮助文档:https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh
- 查看 API 列表:https://docs.github.com/cn/rest
课程采用 Restful API
- 调用 API 时需要在 header 中携带 token:
config.headers['Authorization'] = `token ${this.token}`;
代码块1
Gitee API 接入
接入流程:
创建 SSH 帮助文档:https://gitee.com/help/articles/4191
- 查看 API 列表:https://gitee.com/api/v5/swagger
- 调用 API 时需要在参数中携带 access_token:
get(url, params, headers) {
return this.service({
url,
params: {
...params,
access_token: this.token,
},
method: 'get',
headers,
});
}
默认 .gitignore 模板
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Copyright © 2022 @filway