|
@@ -919,68 +919,3 @@ func (this *UserLoginController) AreaCodeList() {
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
-
|
|
|
-// ThirdLogin
|
|
|
-// @Title 第三方登录
|
|
|
-// @Description 第三方登录
|
|
|
-// @Param request body UserLoginReq true "type json string"
|
|
|
-// @Success 200 {object} models.LoginResp
|
|
|
-// @router /third/login [post]
|
|
|
-//func (this *UserLoginController) ThirdLogin() {
|
|
|
-// br := new(models.BaseResponse).Init()
|
|
|
-// defer func() {
|
|
|
-// if br.ErrMsg == "" {
|
|
|
-// br.IsSendEmail = false
|
|
|
-// }
|
|
|
-// this.Data["json"] = br
|
|
|
-// this.ServeJSON()
|
|
|
-// }()
|
|
|
-//
|
|
|
-// // 入参
|
|
|
-// type UserThirdLoginReq struct {
|
|
|
-// Code string `description:"code"`
|
|
|
-// }
|
|
|
-// var req UserThirdLoginReq
|
|
|
-// err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
-//
|
|
|
-// // 设置redis缓存
|
|
|
-// {
|
|
|
-// // 获取不可信的登录态,并将该登录态重置掉,不允许多次登录
|
|
|
-// noTrustLoginKey := fmt.Sprint(utils.CACHE_ACCESS_TOKEN_LOGIN_NO_TRUST, sysUser.AdminId)
|
|
|
-// noTrustLoginId, _ := utils.Rc.RedisString(noTrustLoginKey)
|
|
|
-// if noTrustLoginId != `` { // 如果存在不可信设备,那么将其下架
|
|
|
-// oldNoTrustLoginKey := fmt.Sprint(utils.CACHE_ACCESS_TOKEN_LOGIN, noTrustLoginId)
|
|
|
-// _ = utils.Rc.Put(oldNoTrustLoginKey, "0", utils.LoginCacheTime*time.Minute)
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 如果当前是不可信设备,那么将其加入到不可信名单
|
|
|
-// loginKey := fmt.Sprint(utils.CACHE_ACCESS_TOKEN_LOGIN, sysSession.Id)
|
|
|
-// _ = utils.Rc.Put(loginKey, "1", utils.LoginCacheTime*time.Minute)
|
|
|
-// _ = utils.Rc.Put(noTrustLoginKey, sysSession.Id, utils.LoginCacheTime*time.Minute)
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 新增登录记录
|
|
|
-// go func() {
|
|
|
-// record := new(system.SysUserLoginRecord)
|
|
|
-// record.Uid = sysUser.AdminId
|
|
|
-// record.UserName = req.Username
|
|
|
-// record.Ip = this.Ctx.Input.IP()
|
|
|
-// record.Stage = "login"
|
|
|
-// record.CreateTime = time.Now()
|
|
|
-// _ = system.AddSysUserLoginRecord(record)
|
|
|
-// }()
|
|
|
-//
|
|
|
-// // ETA试用平台-请求中间服务更新用户最后登录时间和次数
|
|
|
-// if utils.BusinessCode == utils.BusinessCodeSandbox {
|
|
|
-// go func() {
|
|
|
-// var r eta_trial.EtaTrialUserReq
|
|
|
-// r.Mobile = sysUser.Mobile
|
|
|
-// _, _ = eta_trial.UpdateEtaTrialUserLogin(r)
|
|
|
-// }()
|
|
|
-// }
|
|
|
-//
|
|
|
-// br.Data = resp
|
|
|
-// br.Ret = 200
|
|
|
-// br.Success = true
|
|
|
-// br.Msg = "登录成功"
|
|
|
-//}
|