/* * @description:计量支付接口相关操作 * @Author: CP * @Date: 2020-09-03 16:57:56 * @FilePath: \construction_management\lib\jlzf.go */ package lib import ( "go.mod/web/viewmodels" ) type Jlzf struct { AuthUrl string App string Token string } //创建项目用户service func NewJlzf() *Jlzf { return &Jlzf{ AuthUrl: "http://cld.smartcost.com.cn/api/auth", Token: "sc@ConS!tru@ct*88", } } // 验证计量支付项目账号的登陆密码 func (j *Jlzf) LoginValid(loginData viewmodels.Login) error { // TODO 生成令牌和提交时间 //const [encryptToken, postTime] = this.generateCLDToken(); // TODO 有接口在调试 /* req := HttpRequest.NewRequest() res, _ := req.Post(j.AuthUrl, map[string]interface{}{ "code": loginData.Code, "account": loginData.Account, "password": loginData.Password, "posttime": "", "token": "", }) _, err := res.Body() if err != nil { return errors.New("账号或密码不正确") } */ //return string(body) return nil }