增加通过excel批量添加用户的功能,支持导入后自动发邮件

This commit is contained in:
wsczx
2022-10-22 20:36:10 +08:00
parent c6ef0a28b4
commit a77fe77e79
12 changed files with 168 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ package admin
import (
"encoding/json"
"io/ioutil"
"io"
"net/http/httptest"
"testing"
@@ -15,7 +15,7 @@ func TestRespSucess(t *testing.T) {
RespSucess(w, "data")
// fmt.Println(w)
assert.Equal(w.Code, 200)
body, _ := ioutil.ReadAll(w.Body)
body, _ := io.ReadAll(w.Body)
res := Resp{}
err := json.Unmarshal(body, &res)
assert.Nil(err)
@@ -30,7 +30,7 @@ func TestRespError(t *testing.T) {
RespError(w, 10, "err-msg")
// fmt.Println(w)
assert.Equal(w.Code, 200)
body, _ := ioutil.ReadAll(w.Body)
body, _ := io.ReadAll(w.Body)
res := Resp{}
err := json.Unmarshal(body, &res)
assert.Nil(err)