Commit b125831f by shenyizhong

* code review

1 parent fb7d7dec
Showing with 6 additions and 2 deletions
src/.idea/
src/config.json
src/minsync
src/minsync.exe
......
......@@ -251,7 +251,7 @@ func RemotPathExists(path string) (def.ErrCode, error) {
var resp *http.Response
resp, err = http.DefaultClient.Do(req)
if err != nil {
if resp.StatusCode != 200 || err != nil {
log.Println(err)
return def.ERR_HTTP_REQUEST, err
}
......@@ -263,7 +263,10 @@ func RemotPathExists(path string) (def.ErrCode, error) {
}
var dl SvrResp
json.Unmarshal(body, &dl)
err = json.Unmarshal(body, &dl)
if err != nil {
return def.ERR_JSON_PARSE, err
}
if dl.Msg == "user do not login" {
return def.ERR_NOT_LOGIN, nil
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!