We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54cc3cb commit 2200d89Copy full SHA for 2200d89
cmd/login.go
@@ -190,8 +190,7 @@ func saveCookie(cookies []*http.Cookie) error {
190
if c == nil {
191
return fmt.Errorf("Session Cookie 不存在")
192
}
193
- f, err := os.OpenFile(cookieFile, os.O_WRONLY|os.O_CREATE, 0666)
194
- _, err = f.WriteString(c.Name + "=" + c.Value)
+ err := ioutil.WriteFile(cookieFile, []byte(c.Name+"="+c.Value), 0666)
195
if err != nil {
196
return fmt.Errorf("保存 Session Cookie 失败,%v", err)
197
0 commit comments