Account.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\mobile\controller;
  3. use app\admin\logic\CommonLogic;
  4. use app\BaseController;
  5. use app\mobile\logic\AccountLogic;
  6. use think\exception\ValidateException;
  7. use think\facade\Config;
  8. use think\facade\Validate;
  9. //账户
  10. class Account extends BaseController
  11. {
  12. //登录
  13. public function login()
  14. {
  15. $param = $this->request->only(['username', 'password'], 'post');
  16. $val = Validate::rule(Config::get('validate_rules.login'));
  17. if (!$val->check($param)) throw new ValidateException($val->getError());
  18. return AccountLogic::login($param);
  19. }
  20. //登出
  21. public function logout()
  22. {
  23. return AccountLogic::logout();
  24. }
  25. //详情
  26. public function info()
  27. {
  28. return AccountLogic::info();
  29. }
  30. //省市区编码
  31. public function area()
  32. {
  33. $parent_code = $this->request->post('parent_code', '');
  34. return CommonLogic::getAddr($parent_code);
  35. }
  36. //视频列表
  37. public function getVideoList()
  38. {
  39. $param = $this->request->only(['page' => 1, 'size' => 10], 'post');
  40. return AccountLogic::getVideoList($param);
  41. }
  42. //手机主题
  43. public function theme()
  44. {
  45. return AccountLogic::theme();
  46. }
  47. }