user.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. package controllers
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "hongze/hongze_api/models"
  6. "hongze/hongze_api/services"
  7. "hongze/hongze_api/utils"
  8. "strconv"
  9. "strings"
  10. "time"
  11. )
  12. //用户
  13. type UserController struct {
  14. BaseAuthController
  15. }
  16. //用户
  17. type UserCommonController struct {
  18. BaseCommonController
  19. }
  20. //用户不登录
  21. type UserNotAuthController struct{
  22. BaseNotAuthController
  23. }
  24. // @Title 获取用户详情
  25. // @Description 获取用户详情接口
  26. // @Success 200 {object} models.UserDetail
  27. // @router /detail [get]
  28. func (this *UserController) Detail() {
  29. br := new(models.BaseResponse).Init()
  30. defer func() {
  31. this.Data["json"] = br
  32. this.ServeJSON()
  33. }()
  34. user := this.User
  35. if user == nil {
  36. br.Msg = "请登录"
  37. br.ErrMsg = "请登录,用户信息为空"
  38. br.Ret = 408
  39. return
  40. }
  41. item, err := models.GetUserDetailByUserId(user.UserId)
  42. if err != nil {
  43. br.Msg = "获取信息失败"
  44. br.ErrMsg = "获取信息失败,Err:" + err.Error()
  45. return
  46. }
  47. userPermission, err := services.CheckUserPermission(user.UserId)
  48. if err != nil {
  49. br.Msg = "获取信息失败"
  50. br.ErrMsg = "判断用户权限信息失败,Err:" + err.Error()
  51. return
  52. }
  53. if item.Mobile == "" && item.Email == "" {
  54. item.FirstLogin = 1
  55. }
  56. //新增访问日志
  57. {
  58. record:=new(models.UserAccessRecord)
  59. record.Uid=user.UserId
  60. record.Token=this.Token
  61. record.CreateTime=time.Now()
  62. go models.AddUserAccessRecord(record)
  63. }
  64. item.UserPermission = userPermission
  65. br.Ret = 200
  66. br.Success = true
  67. br.Msg = "获取成功"
  68. br.Data = item
  69. }
  70. // @Title 获取短信验证码
  71. // @Description 获取短信验证码接口
  72. // @Param Mobile query string true "手机号码"
  73. // @Param AreaNum query string true "地区编码"
  74. // @Success Ret=200 获取成功
  75. // @router /getSmsCode [get]
  76. func (this *UserNotAuthController) GetSmsCode() {
  77. br := new(models.BaseResponse).Init()
  78. defer func() {
  79. this.Data["json"] = br
  80. this.ServeJSON()
  81. }()
  82. mobile := this.GetString("Mobile")
  83. if mobile == "" {
  84. br.Msg = "请输入手机号"
  85. return
  86. }
  87. areaNum := this.GetString("AreaNum")
  88. msgCode := utils.GetRandDigit(4)
  89. var result bool
  90. if areaNum == "86" || areaNum == "" || areaNum == "0" {
  91. result = services.SendSmsCode(mobile, msgCode)
  92. } else {
  93. result = services.SendSmsCodeGj(mobile, msgCode, areaNum)
  94. }
  95. //发送成功
  96. if result {
  97. item := new(models.MsgCode)
  98. item.OpenId = ""
  99. item.Code = msgCode
  100. item.Mobile = mobile
  101. item.ExpiredIn = time.Now().Add(15 * time.Minute).Unix()
  102. item.Enabled = 1
  103. item.CreatedTime = time.Now()
  104. err := models.AddMsgCode(item)
  105. if err != nil {
  106. br.Msg = "发送失败"
  107. br.ErrMsg = "发送失败,Err:" + err.Error()
  108. return
  109. }
  110. br.Msg = "发送成功"
  111. } else {
  112. br.Msg = "发送失败"
  113. }
  114. br.Ret = 200
  115. br.Success = true
  116. }
  117. // @Title 校验短信验证码
  118. // @Description 校验短信验证码接口
  119. // @Param request body models.CheckSmsCodeReq true "type json string"
  120. // @Success Ret=200 校验成功
  121. // @router /checkSmsCode [post]
  122. func (this *UserNotAuthController) CheckSmsCode() {
  123. br := new(models.BaseResponse).Init()
  124. defer func() {
  125. this.Data["json"] = br
  126. this.ServeJSON()
  127. }()
  128. var req models.CheckSmsCodeReq
  129. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  130. if err != nil {
  131. br.Msg = "参数解析异常!"
  132. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  133. return
  134. }
  135. if req.Mobile == "" {
  136. br.Msg = "请输入手机号"
  137. br.ErrMsg = "请输入手机号"
  138. return
  139. }
  140. if req.SmsCode == "" {
  141. br.Msg = "请输入验证码"
  142. br.ErrMsg = "请输入验证码"
  143. return
  144. }
  145. item, err := models.GetMsgCode(req.Mobile, req.SmsCode)
  146. if err != nil {
  147. if err.Error() == utils.ErrNoRow() {
  148. br.Msg = "验证码错误,请重新输入"
  149. br.ErrMsg = "校验验证码失败,Err:" + err.Error()
  150. return
  151. } else {
  152. br.Msg = "验证码错误,请重新输入"
  153. br.ErrMsg = "校验验证码失败,Err:" + err.Error()
  154. return
  155. }
  156. }
  157. if item == nil {
  158. br.Msg = "验证码错误,请重新输入"
  159. return
  160. }
  161. br.Ret = 200
  162. br.Success = true
  163. br.Msg = "验证码正确"
  164. }
  165. // @Title 获取邮件验证码
  166. // @Description 获取邮件验证码接口
  167. // @Param Email query string true "邮箱"
  168. // @Success Ret=200 获取成功
  169. // @router /getEmailCode [get]
  170. func (this *UserNotAuthController) GetEmailCode() {
  171. br := new(models.BaseResponse).Init()
  172. defer func() {
  173. this.Data["json"] = br
  174. this.ServeJSON()
  175. }()
  176. email := this.GetString("Email")
  177. if email == "" {
  178. br.Msg = "请输入邮箱地址"
  179. return
  180. }
  181. if !utils.ValidateEmailFormatat(email) {
  182. br.Msg = "邮箱格式错误,请重新输入"
  183. return
  184. }
  185. msgCode := utils.GetRandDigit(4)
  186. content := "尊敬的用户:</br>您好,感谢您使用弘则研究,您正在进行邮箱验证,本次请求的验证码为:" + msgCode + "(为了保障您账号的安全性,请在15分钟内完成验证。)</br>弘则研究团队 </br>2019年05月11日"
  187. title := "弘则研究登陆验证"
  188. //发送邮件
  189. result, err := utils.SendEmailByHz(title, content, email)
  190. if err != nil {
  191. br.Msg = "发送失败"
  192. br.ErrMsg = "发送失败,Err:" + err.Error()
  193. return
  194. }
  195. if result {
  196. item := new(models.MsgCode)
  197. item.OpenId = ""
  198. item.Code = msgCode
  199. item.Mobile = email
  200. item.ExpiredIn = time.Now().Add(15 * time.Minute).Unix()
  201. item.Enabled = 1
  202. item.CreatedTime = time.Now()
  203. err := models.AddMsgCode(item)
  204. if err != nil {
  205. br.Msg = "发送失败"
  206. br.ErrMsg = "发送失败,Err:" + err.Error()
  207. return
  208. }
  209. br.Msg = "发送成功"
  210. } else {
  211. br.Msg = "发送失败"
  212. }
  213. br.Ret = 200
  214. br.Success = true
  215. }
  216. // @Title 校验邮箱验证码
  217. // @Description 校验邮箱验证码接口
  218. // @Param request body models.CheckEmailCodeReq true "type json string"
  219. // @Success Ret=200 校验成功
  220. // @router /checkEmailCode [post]
  221. func (this *UserNotAuthController) CheckEmailCode() {
  222. br := new(models.BaseResponse).Init()
  223. defer func() {
  224. this.Data["json"] = br
  225. this.ServeJSON()
  226. }()
  227. var req models.CheckEmailCodeReq
  228. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  229. if err != nil {
  230. br.Msg = "参数解析异常!"
  231. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  232. return
  233. }
  234. if req.Email == "" {
  235. br.Msg = "请输入手机号"
  236. br.ErrMsg = "请输入手机号"
  237. return
  238. }
  239. if req.SmsCode == "" {
  240. br.Msg = "请输入验证码"
  241. br.ErrMsg = "请输入验证码"
  242. return
  243. }
  244. item, err := models.GetMsgCode(req.Email, req.SmsCode)
  245. if err != nil {
  246. if err.Error() == utils.ErrNoRow() {
  247. br.Msg = "验证码错误,请重新输入"
  248. br.ErrMsg = "校验验证码失败,Err:" + err.Error()
  249. return
  250. } else {
  251. br.Msg = "验证码错误,请重新输入"
  252. br.ErrMsg = "校验验证码失败,Err:" + err.Error()
  253. return
  254. }
  255. }
  256. if item == nil {
  257. br.Msg = "验证码错误,请重新输入"
  258. return
  259. }
  260. br.Ret = 200
  261. br.Success = true
  262. br.Msg = "验证码正确"
  263. }
  264. // @Title 登录
  265. // @Description 登录接口
  266. // @Param request body models.LoginReq true "type json string"
  267. // @Success 200 {object} models.LoginResp
  268. // @router /login [post]
  269. func (this *UserNotAuthController) Login() {
  270. br := new(models.BaseResponse).Init()
  271. defer func() {
  272. this.Data["json"] = br
  273. this.ServeJSON()
  274. }()
  275. var req models.LoginReq
  276. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  277. if err != nil {
  278. br.Msg = "参数解析异常!"
  279. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  280. return
  281. }
  282. user := this.User
  283. if user == nil {
  284. br.Msg = "请登录"
  285. br.ErrMsg = "请登录"
  286. br.Ret = 408
  287. return
  288. }
  289. openId := user.OpenId
  290. if openId == "" {
  291. br.Msg = "参数错误"
  292. br.ErrMsg = "参数错误,openid 为空"
  293. return
  294. }
  295. if req.LoginType == 1 {
  296. //手机登录
  297. if req.Mobile == "" {
  298. br.ErrMsg = "手机号不能为空,请输入手机号"
  299. br.Msg = "手机号不能为空,请输入手机号"
  300. return
  301. }
  302. req.Mobile = strings.Trim(req.Mobile, " ")
  303. } else if req.LoginType == 2 {
  304. //邮箱登录
  305. if req.Email == "" {
  306. br.ErrMsg = "邮箱不能为空,请输入邮箱"
  307. br.Msg = "邮箱不能为空,请输入邮箱"
  308. return
  309. }
  310. if !utils.ValidateEmailFormatat(req.Email) {
  311. br.ErrMsg = "邮箱格式错误,请重新输入"
  312. br.Msg = "邮箱格式错误,请重新输入"
  313. return
  314. }
  315. } else {
  316. br.Msg = "无效的登录方式"
  317. br.ErrMsg = "无效的登录方式,Err:" + err.Error()
  318. return
  319. }
  320. user,err = services.BindWxUser(openId,req.Mobile,req.Email)
  321. userId := user.UserId
  322. var token string
  323. tokenItem, err := models.GetTokenByOpenId(openId)
  324. if err != nil && err.Error() != utils.ErrNoRow() {
  325. br.Msg = "登录失败"
  326. br.ErrMsg = "登录失败,获取token失败:" + err.Error()
  327. return
  328. }
  329. if tokenItem == nil || (err != nil && err.Error() == utils.ErrNoRow()) {
  330. timeUnix := time.Now().Unix()
  331. timeUnixStr := strconv.FormatInt(timeUnix, 10)
  332. token := utils.MD5(openId) + utils.MD5(timeUnixStr)
  333. //新增session
  334. {
  335. session := new(models.Session)
  336. session.OpenId = openId
  337. session.UserId = userId
  338. session.CreatedTime = time.Now()
  339. session.LastUpdatedTime = time.Now()
  340. session.ExpireTime = time.Now().AddDate(0, 1, 0)
  341. session.AccessToken = token
  342. err = models.AddSession(session)
  343. if err != nil {
  344. br.Msg = "登录失败"
  345. br.ErrMsg = "登录失败,新增用户session信息失败:" + err.Error()
  346. return
  347. }
  348. }
  349. } else {
  350. token = tokenItem.AccessToken
  351. }
  352. userPermission, err := services.CheckUserPermission(userId)
  353. if err != nil {
  354. br.Msg = "登录失败"
  355. br.ErrMsg = "登录失败,判断权限失败:" + err.Error()
  356. return
  357. }
  358. err = models.ModifyFirstLogin(user.UserId)
  359. if err != nil {
  360. br.Msg = "登录失败"
  361. br.ErrMsg = "登录失败,判断权限失败:" + err.Error()
  362. return
  363. }
  364. //新增登录日志
  365. {
  366. loginLog := new(models.WxUserLog)
  367. loginLog.UserId = userId
  368. loginLog.OpenId = openId
  369. loginLog.Mobile=req.Mobile
  370. loginLog.Email=req.Email
  371. loginLog.CreateTime = time.Now()
  372. loginLog.Handle="wechat_user_login"
  373. loginLog.Remark=token
  374. go models.AddWxUserLog(loginLog)
  375. }
  376. resp := new(models.LoginResp)
  377. resp.UserId = userId
  378. resp.UserPermission = userPermission
  379. resp.Authorization = token
  380. br.Ret = 200
  381. br.Success = true
  382. br.Data = resp
  383. br.Msg = "登录成功"
  384. }
  385. //func (this *UserController) Login() {
  386. // br := new(models.BaseResponse).Init()
  387. // defer func() {
  388. // this.Data["json"] = br
  389. // this.ServeJSON()
  390. // }()
  391. // var req models.LoginReq
  392. // err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  393. // if err != nil {
  394. // br.Msg = "参数解析异常!"
  395. // br.ErrMsg = "参数解析失败,Err:" + err.Error()
  396. // return
  397. // }
  398. // user := this.User
  399. // if user == nil {
  400. // br.Msg = "请登录"
  401. // br.ErrMsg = "请登录"
  402. // br.Ret = 408
  403. // return
  404. // }
  405. //
  406. // openId := user.OpenId
  407. // if openId == "" {
  408. // br.Msg = "参数错误"
  409. // br.ErrMsg = "参数错误,openid 为空"
  410. // return
  411. // }
  412. // userId := user.UserId
  413. // newUserId := 0
  414. // if req.LoginType == 1 {
  415. // //BindMobile(openId, mobile string, userId, loginType int) (err error) {
  416. // req.Mobile = strings.Trim(req.Mobile, " ")
  417. // newUserId, err = models.BindMobile(openId, req.Mobile, userId, req.LoginType)
  418. // } else if req.LoginType == 2 {
  419. // if req.Email == "" {
  420. // br.ErrMsg = "邮箱不能为空,请输入邮箱"
  421. // br.Msg = "邮箱不能为空,请输入邮箱"
  422. // return
  423. // }
  424. // if !utils.ValidateEmailFormatat(req.Email) {
  425. // br.ErrMsg = "邮箱格式错误,请重新输入"
  426. // br.Msg = "邮箱格式错误,请重新输入"
  427. // return
  428. // }
  429. // newUserId, err = models.BindMobile(openId, req.Email, userId, req.LoginType)
  430. // } else {
  431. // br.Msg = "无效的登录方式"
  432. // br.ErrMsg = "无效的登录方式,Err:" + err.Error()
  433. // return
  434. // }
  435. // var token string
  436. // tokenItem, err := models.GetTokenByUid(newUserId)
  437. // if err != nil && err.Error() != utils.ErrNoRow() {
  438. // br.Msg = "登录失败"
  439. // br.ErrMsg = "登录失败,获取token失败:" + err.Error()
  440. // return
  441. // }
  442. //
  443. // if tokenItem == nil || (err != nil && err.Error() == utils.ErrNoRow()) {
  444. // timeUnix := time.Now().Unix()
  445. // timeUnixStr := strconv.FormatInt(timeUnix, 10)
  446. // token := utils.MD5(strconv.Itoa(userId)) + utils.MD5(timeUnixStr)
  447. // //新增session
  448. // {
  449. // session := new(models.Session)
  450. // session.OpenId = openId
  451. // session.UserId = userId
  452. // session.CreatedTime = time.Now()
  453. // session.LastUpdatedTime = time.Now()
  454. // session.ExpireTime = time.Now().AddDate(0, 1, 0)
  455. // session.AccessToken = token
  456. // err = models.AddSession(session)
  457. // if err != nil {
  458. // br.Msg = "登录失败"
  459. // br.ErrMsg = "登录失败,新增用户session信息失败:" + err.Error()
  460. // return
  461. // }
  462. // }
  463. // } else {
  464. // token = tokenItem.AccessToken
  465. // }
  466. // userPermission, err := services.CheckUserPermission(newUserId)
  467. // if err != nil {
  468. // br.Msg = "登录失败"
  469. // br.ErrMsg = "登录失败,判断权限失败:" + err.Error()
  470. // return
  471. // }
  472. // err = models.ModifyFirstLogin(user.UserId)
  473. // if err != nil {
  474. // br.Msg = "登录失败"
  475. // br.ErrMsg = "登录失败,判断权限失败:" + err.Error()
  476. // return
  477. // }
  478. //
  479. // //新增登录日志
  480. // {
  481. // loginLog := new(models.WxUserLog)
  482. // loginLog.UserId = userId
  483. // loginLog.OpenId = openId
  484. // loginLog.Mobile=req.Mobile
  485. // loginLog.Email=req.Email
  486. // loginLog.CreateTime = time.Now()
  487. // loginLog.Handle="wechat_user_login"
  488. // loginLog.Remark=token
  489. // go models.AddWxUserLog(loginLog)
  490. // }
  491. //
  492. // resp := new(models.LoginResp)
  493. // resp.UserId = newUserId
  494. // resp.UserPermission = userPermission
  495. // resp.Authorization = token
  496. // br.Ret = 200
  497. // br.Success = true
  498. // br.Data = resp
  499. // br.Msg = "登录成功"
  500. //}
  501. // @Title 申请试用
  502. // @Description 申请试用接口
  503. // @Param request body models.ApplyReq true "type json string"
  504. // @Success Ret=200 申请成功
  505. // @router /apply [post]
  506. func (this *UserController) Apply() {
  507. br := new(models.BaseResponse).Init()
  508. defer func() {
  509. this.Data["json"] = br
  510. this.ServeJSON()
  511. }()
  512. user := this.User
  513. if user == nil {
  514. br.Msg = "请登录"
  515. br.ErrMsg = "请登录"
  516. br.Ret = 408
  517. return
  518. }
  519. var req models.ApplyReq
  520. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  521. if err != nil {
  522. br.Msg = "参数解析异常!"
  523. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  524. return
  525. }
  526. realName := req.RealName
  527. userId := user.UserId
  528. if req.ApplyMethod == 2 {
  529. if realName == "" {
  530. br.Msg = "姓名不能为空!"
  531. return
  532. }
  533. }
  534. if realName == "" {
  535. realName = user.RealName
  536. }
  537. err = models.Apply(userId, req.ApplyMethod, user.Mobile, user.Email, req.CompanyName, realName, user.OpenId)
  538. if err != nil {
  539. br.Msg = "申请失败!"
  540. br.ErrMsg = "申请失败,Err:" + err.Error()
  541. return
  542. }
  543. br.Ret = 200
  544. br.Success = true
  545. br.Msg = "申请成功"
  546. }
  547. // @Title 是否小套餐客户
  548. // @Description 是否小套餐客户接口
  549. // @Success 200 {object} models.SmallLimitResp
  550. // @router /smallLimit [get]
  551. func (this *UserController) SmallLimit() {
  552. br := new(models.BaseResponse).Init()
  553. defer func() {
  554. this.Data["json"] = br
  555. this.ServeJSON()
  556. }()
  557. user := this.User
  558. if user == nil {
  559. br.Msg = "请登录"
  560. br.ErrMsg = "请登录"
  561. br.Ret = 408
  562. return
  563. }
  564. userItem, err := models.GetWxUserItemByUserId(user.UserId)
  565. if err != nil {
  566. br.Msg = "获取用户信息失败"
  567. br.ErrMsg = "获取用户信息失败,Err:" + err.Error()
  568. return
  569. }
  570. if userItem == nil {
  571. br.Msg = "获取用户信息失败"
  572. br.ErrMsg = "用户信息不存在,UserId:" + strconv.Itoa(user.UserId)
  573. return
  574. }
  575. maxCount, err := models.GetUserIsMaxPermission(userItem.CompanyId)
  576. if err != nil {
  577. br.Msg = "获取用户信息失败"
  578. br.ErrMsg = "判断是否最大客户权限失败,Err:" + err.Error()
  579. return
  580. }
  581. resp := new(models.SmallLimitResp)
  582. if maxCount >= 15 {
  583. resp.IsMaxPermission = 1
  584. } else {
  585. resp.IsMaxPermission = 0
  586. }
  587. br.Ret = 200
  588. br.Success = true
  589. br.Data = resp
  590. }
  591. // @Title test
  592. // @Description test接口
  593. // @Param request body models.CheckEmailCodeReq true "type json string"
  594. // @Success Ret=200 校验成功
  595. // @router /test [get]
  596. func (this *UserNotAuthController) Test() {
  597. br := new(models.BaseResponse).Init()
  598. defer func() {
  599. this.Data["json"] = br
  600. this.ServeJSON()
  601. }()
  602. openid := "oN0jD1S3P-FVosLhq-YiVOXldtRo"
  603. wxUser,err := services.GetWxUserItemByOpenId(openid)
  604. fmt.Println(err)
  605. fmt.Println(wxUser)
  606. fmt.Println("-----------")
  607. //wxUser,err = models.GetWxUserItemByOpenId(openid)
  608. //fmt.Println(err)
  609. //fmt.Println(wxUser)
  610. //fmt.Println("-----------")
  611. userId := 12274
  612. userId = 12018
  613. platform := 2
  614. wxUser,err = services.GetWxUserItemByUserId(userId,platform)
  615. fmt.Println(err)
  616. fmt.Println(wxUser)
  617. fmt.Println("根据用户id获取结束-----------")
  618. mobile := "18170239278"
  619. wxUser,err = services.GetWxUserItemByMobile(mobile,platform)
  620. fmt.Println(err)
  621. fmt.Println(wxUser)
  622. fmt.Println("根据手机号获取结束-----------")
  623. email := "984198890@qq.com"
  624. wxUser,err = services.GetWxUserItemByEmail(email,platform)
  625. fmt.Println(err)
  626. fmt.Println(wxUser)
  627. fmt.Println("根据邮箱获取结束-----------")
  628. unionId := "o1q5cwOzXXA9Hy9PTEIwxP81Casg"
  629. wxUser,err = services.GetWxUserItemByUnionId(unionId,platform)
  630. fmt.Println(err)
  631. fmt.Println(wxUser)
  632. fmt.Println("根据unionid获取结束-----------")
  633. br.Ret = 200
  634. br.Success = true
  635. br.Msg = "验证码正确"
  636. }