Skip to content

Commit

Permalink
🐛 部分命令未兼容 token验证 (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoJamie authored Jul 20, 2024
1 parent 089232e commit d63ac82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func GetIssueList(projectName, username string) []IssueListResp {
url := common.GithubApiReposDomain + "/isxcode/" + projectName + "/issues?state=open&assignee=" + username
req, err := http.NewRequest("GET", url, nil)

req.Header = common.GitHubHeader(viper.GetString("user.token"))
req.Header = common.GitHubHeader(common.GetToken())
resp, err := client.Do(req)
if err != nil {
fmt.Println("请求失败:", err)
Expand Down
3 changes: 1 addition & 2 deletions github/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package github
import (
"fmt"
"github.com/isxcode/isx-cli/common"
"github.com/spf13/viper"
"io"
"net/http"
"os"
Expand All @@ -24,7 +23,7 @@ func request(url, method string, reqBody io.Reader) *http.Response {
client := &http.Client{}
req, err := http.NewRequest(method, url, reqBody)

req.Header = common.GitHubHeader(viper.GetString("user.token"))
req.Header = common.GitHubHeader(common.GetToken())
resp, err := client.Do(req)
if err != nil {
fmt.Println("请求失败:", err)
Expand Down

0 comments on commit d63ac82

Please sign in to comment.