func GetTokenForTest(e *httpexpect.Expect, username, password string, ex int) string {
	body := e.GET("/api/v1.0/token").WithQuery("ex", ex).
		WithBasicAuth(username, password).Expect().Body().Raw()
	var mytokenResponse tokenResponse
	json.Unmarshal([]byte(body), &mytokenResponse)
	return mytokenResponse.Data.Token
}
get token by username and password for test
package main
import (
	"encoding/json"
	"github.com/iris-contrib/httpexpect"
	"github.com/muxiyun/Mae/handler"
	"strings"
)
type token struct {
	Token string `json:"token"`
}
type tokenResponse struct {
	Code uint   `json:"code"`
	Data token  `json:"data"`
	Msg  string `json:"msg"`
}