diff --git a/bin/json/game_taskround.json b/bin/json/game_taskround.json index 3a80740c2..ccd660a63 100644 --- a/bin/json/game_taskround.json +++ b/bin/json/game_taskround.json @@ -84,7 +84,7 @@ }, "type_id": 10003, "active": 0, - "id_after": 10004, + "id_after": 30002, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -105,7 +105,7 @@ }, "type_id": 10004, "active": 0, - "id_after": 10005, + "id_after": 30003, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -126,7 +126,7 @@ }, "type_id": 10005, "active": 0, - "id_after": 10006, + "id_after": 30004, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -147,7 +147,7 @@ }, "type_id": 10006, "active": 0, - "id_after": 10007, + "id_after": 30005, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -168,7 +168,7 @@ }, "type_id": 10007, "active": 0, - "id_after": 10008, + "id_after": 30006, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -189,7 +189,7 @@ }, "type_id": 10008, "active": 0, - "id_after": 10009, + "id_after": 30007, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -210,7 +210,7 @@ }, "type_id": 10009, "active": 0, - "id_after": 10010, + "id_after": 30008, "jump_interface": 103, "icon": "rw_cj_icon10", "reword": [ @@ -243,16 +243,16 @@ ] }, { - "key": 30009, + "key": 30101, "id_list": 24, "id_tag": 3, "task_display": { - "key": "task_30009", + "key": "task_30101", "text": "进行10次普通招募" }, "type_id": 10203, "active": 0, - "id_after": 10204, + "id_after": 30102, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -264,16 +264,16 @@ ] }, { - "key": 30010, + "key": 30102, "id_list": 25, "id_tag": 3, "task_display": { - "key": "task_30010", + "key": "task_30102", "text": "进行20次普通招募" }, "type_id": 10204, "active": 0, - "id_after": 10205, + "id_after": 30103, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -285,16 +285,16 @@ ] }, { - "key": 30011, + "key": 30103, "id_list": 26, "id_tag": 3, "task_display": { - "key": "task_30011", + "key": "task_30103", "text": "进行50次普通招募" }, "type_id": 10205, "active": 0, - "id_after": 10206, + "id_after": 30104, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -306,16 +306,16 @@ ] }, { - "key": 30012, + "key": 30104, "id_list": 27, "id_tag": 3, "task_display": { - "key": "task_30012", + "key": "task_30104", "text": "进行100次普通招募" }, "type_id": 10206, "active": 0, - "id_after": 10207, + "id_after": 30105, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -327,16 +327,16 @@ ] }, { - "key": 30013, + "key": 30105, "id_list": 28, "id_tag": 3, "task_display": { - "key": "task_30013", + "key": "task_30105", "text": "进行200次普通招募" }, "type_id": 10207, "active": 0, - "id_after": 10208, + "id_after": 30106, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -348,16 +348,16 @@ ] }, { - "key": 30014, + "key": 30106, "id_list": 29, "id_tag": 3, "task_display": { - "key": "task_30014", + "key": "task_30106", "text": "进行300次普通招募" }, "type_id": 10208, "active": 0, - "id_after": 10209, + "id_after": 30107, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -369,16 +369,16 @@ ] }, { - "key": 30015, + "key": 30107, "id_list": 30, "id_tag": 3, "task_display": { - "key": "task_30015", + "key": "task_30107", "text": "进行500次普通招募" }, "type_id": 10209, "active": 0, - "id_after": 10210, + "id_after": 30108, "jump_interface": 107, "icon": "rw_cj_icon15", "reword": [ @@ -390,11 +390,11 @@ ] }, { - "key": 30016, + "key": 30108, "id_list": 31, "id_tag": 3, "task_display": { - "key": "task_30016", + "key": "task_30108", "text": "进行1000次普通招募" }, "type_id": 10210, diff --git a/cmd/v2/service/sshService.go b/cmd/v2/service/sshService.go index 2beefd12c..35870c95f 100644 --- a/cmd/v2/service/sshService.go +++ b/cmd/v2/service/sshService.go @@ -113,7 +113,7 @@ func (ss *SSHService) RunShell(shell string) { } //单个copy -func (ss *SSHService) ScpCopy(localFilePath, remoteDir string) error { +func (ss *SSHService) ScpCopy(localFilePath, remoteDir string) error { var ( err error ) @@ -123,7 +123,6 @@ func (ss *SSHService) ScpCopy(localFilePath, remoteDir string) error { } defer sftpClient.Close() - srcFile, err := os.Open(localFilePath) if err != nil { log.Println("scpCopy:", err) @@ -139,14 +138,13 @@ func (ss *SSHService) ScpCopy(localFilePath, remoteDir string) error { } defer dstFile.Close() - buf := make([]byte, 1024) - for { - n, _ := srcFile.Read(buf) - if n == 0 { - break - } - dstFile.Write(buf[0:n]) + fileByte, err := ioutil.ReadAll(srcFile) + if nil != err { + return fmt.Errorf("read local file failed: %w", err) } + + dstFile.Write(fileByte) + return nil } func (ss *SSHService) Scp(targetDir, srcFileName string) (int, error) { diff --git a/cmd/v2/service/ssh_test.go b/cmd/v2/service/ssh_test.go index cbb208860..bfbab6e97 100644 --- a/cmd/v2/service/ssh_test.go +++ b/cmd/v2/service/ssh_test.go @@ -37,7 +37,7 @@ func TestScp(t *testing.T) { t.Fatal(err) } - if err := ssh.ScpCopy(`E:/svn/dreamworks/client/dreamworks/ExcelFile/check.bat`, "/opt"); err != nil { + if err := ssh.ScpCopy(`E:/svn/dreamworks/client/dreamworks/ExcelFile/testscp.txt`, "/opt"); err != nil { fmt.Println(err) }