We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
纪录GitHub API 的使用方式,便于改造 blog。
点击 这里,勾选以下两项:
read: user Read all user profile data user: email Access user email addresses (read-only)
⚠️警告️:别的不要勾选,以免造成账号安全问题。
如果你的项目是属于一个组织的,还需要勾选一个权限:
read: org Read org and team membership
打开 Chrome 的 Console,运行:
window.btoa('{你的 GitHub Token}')
如果你把 Token 直接明文推到 GitHub 仓库中,此 Token 就会立马失效,所以需要加密混淆。
在 node.js 环境中,借助 Buffer
console.log(Buffer.from("Hello World!").toString("base64")); console.log(Buffer.from("Hello World!", "base64").toString());
import axios from 'axios'; const axiosInstance = axios.create({ baseURL: 'https://api.github.com', headers: { Accept: 'application/vnd.github.v3.html', Authorization: `token ${window.atob(accessToken)}`, }, });
https://api.github.com/users/yanyue404
https://api.github.com/repos/yanyue404/blog/issues/114
https://api.github.com/repos/yanyue404/blog/issues?state=open
https://api.github.com/users/yanyue404/starred
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前言
纪录GitHub API 的使用方式,便于改造 blog。
获取 GitHub Token
点击 这里,勾选以下两项:
如果你的项目是属于一个组织的,还需要勾选一个权限:
GitHub Token 进行 Base64 加密
打开 Chrome 的 Console,运行:
如果你把 Token 直接明文推到 GitHub 仓库中,此 Token 就会立马失效,所以需要加密混淆。
在 node.js 环境中,借助 Buffer
axios 请求 utils
API
https://api.github.com/users/yanyue404
https://api.github.com/repos/yanyue404/blog/issues/114
https://api.github.com/repos/yanyue404/blog/issues?state=open
https://api.github.com/users/yanyue404/starred
参考链接
The text was updated successfully, but these errors were encountered: