|
|
@ -41,7 +41,7 @@ K3cloud 登录 |
|
|
|
*/ |
|
|
|
func (k3config *K3config) Login() { |
|
|
|
formParams := util.CreateLoginPostData(k3config.AcctID, k3config.Username, k3config.Password, k3config.LcID) |
|
|
|
res := k3config.session.PostJson(k3config.CloudUrl+util.LOGIN_API, formParams) |
|
|
|
res, _ := k3config.session.PostJson(k3config.CloudUrl+util.LOGIN_API, formParams) |
|
|
|
k3Response := response.K3LoginResponseToStruct(res) |
|
|
|
if k3Response.LoginResultType == 0 { |
|
|
|
panic(k3Response.Message) |
|
|
@ -49,8 +49,26 @@ func (k3config *K3config) Login() { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
查询数据 |
|
|
|
*/ |
|
|
|
func (K3config *K3config) SearchApi(formId string, search interface{}) ([][]string, error) { |
|
|
|
//root.Model
|
|
|
|
formParams := util.CreateBusinessPostData(formId, util.Struct2Map(search)) |
|
|
|
res, err := K3config.GetSession().PostJson(K3config.CloudUrl+util.GETBILL_API, formParams) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
return response.K3ResponseToMap(res), nil |
|
|
|
//K3config.K3Response = response.K3ResponseToStruct(res)
|
|
|
|
//if K3config.K3Response.Result.ResponseStatus.IsSuccess == false {
|
|
|
|
// return fmt.Errorf(string(res))
|
|
|
|
//}
|
|
|
|
//return nil
|
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
/** |
|
|
|
返回session |
|
|
|
*/ |
|
|
|
func (k3config *K3config) GetSession() *util.Browser { |
|
|
|
return k3config.session |
|
|
|
} |
|
|
|