Login.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace Content\V1;
  3. use Dever;
  4. class Login
  5. {
  6. /**
  7. * @api {get} common 公共参数
  8. * @apiVersion 1.0.0
  9. * @apiName common
  10. * @apiGroup Common
  11. *
  12. * @apiDescription 介绍公共参数
  13. *
  14. * @apiParam {Number} json 是否返回json格式的数据1为返回2为不返回
  15. *
  16. * @apiSuccess {Number} status 状态,1为有效2为无效
  17. * @apiSuccess {String} msg 请求的数据是否成功的提示
  18. * @apiSuccess {String} data 如果status为1,data有值
  19. * @apiSuccess {Object[]} page 分页信息
  20. * @apiSuccess {Number} page.total 分页总数
  21. * @apiSuccess {Number} page.current_page 当前页
  22. * @apiSuccess {Number} page.total_page 总页数
  23. * @apiSuccess {Number} page.next_page 下一页
  24. * @apiSuccess {Number} page.prev_page 上一页
  25. * @apiSuccess {Number} page.status 是否有下一页数据,0为没有
  26. *
  27. * @apiSuccessExample 操作成功
  28. * {"status":1,"code":1,"msg":"success","data":{"uid":1,"session":"111"}}
  29. *
  30. * @apiErrorExample 操作失败
  31. * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
  32. */
  33. /**
  34. * @api {get} v1/login.bind 用户登录
  35. * @apiVersion 1.0.0
  36. * @apiName login.bind
  37. * @apiGroup User
  38. *
  39. * @apiDescription 用户登录接口
  40. *
  41. * @apiParam {Number} appid 小程序id
  42. * @apiParam {String} code 小程序登录的code
  43. *
  44. * @apiSuccess {Number} uid 用户id
  45. * @apiSuccess {String} session 验证用户有效性的session key 请保存在客户端
  46. *
  47. * @apiSuccessExample 操作成功
  48. * {"status":1,"code":1,"msg":"success","data":{"uid":1,"session":"111"}}
  49. *
  50. * @apiErrorExample 操作失败
  51. * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
  52. */
  53. public function bind_api()
  54. {
  55. return Dever::load('passport/login.bind');
  56. }
  57. /**
  58. * @api {get} v1/login.update 更新用户信息
  59. * @apiVersion 1.0.0
  60. * @apiName login.update
  61. * @apiGroup User
  62. *
  63. * @apiDescription 用户更新信息接口
  64. *
  65. * @apiParam {Number} appid 小程序id
  66. * @apiParam {Number} uid 用户id
  67. * @apiParam {String} session 验证用户的session
  68. * @apiParam {String} nickname 用户昵称
  69. * @apiParam {String} avatarurl 头像
  70. * @apiParam {String} gender 性别
  71. * @apiParam {Number} mobile 手机号(目前没有手机号)
  72. * @apiParam {String} city 城市
  73. * @apiParam {String} province 省份
  74. * @apiParam {String} country 国家
  75. *
  76. * @apiSuccess {Number} uid 用户id
  77. *
  78. * @apiSuccessExample 操作成功
  79. * {"status":1,"code":1,"msg":"success","data":1}
  80. *
  81. * @apiErrorExample 操作失败
  82. * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
  83. */
  84. public function update_api()
  85. {
  86. return Dever::load('passport/login.update');
  87. }
  88. }