Account.php 927 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\abutment\controller;
  3. use app\abutment\logic\Account as AccountLogic;
  4. use think\facade\Config;
  5. use think\facade\Validate;
  6. //供应商账号
  7. class Account extends HomeBaseController
  8. {
  9. //供应商账号登录
  10. public function login()
  11. {
  12. $param = $this->request->filter('trim')->only(['mobile', 'password'], 'post');
  13. $val = Validate::rule(Config::get('validate_rules.login'));
  14. if (!$val->check($param)) return json_show(1004, $val->getError());
  15. return AccountLogic::login($param);
  16. }
  17. //获取用户信息
  18. public function getUserInfo()
  19. {
  20. $param = $this->request->filter('trim')->only(['token'], 'post');
  21. $val = Validate::rule(['token|用户token' => 'require|length:40|alphaNum']);
  22. if (!$val->check($param)) return json_show(1004, $val->getError());
  23. return AccountLogic::getUserInfo($param['token']);
  24. }
  25. }