12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\abutment\controller;
- use app\abutment\logic\Account as AccountLogic;
- use think\facade\Config;
- use think\facade\Validate;
- //供应商账号
- class Account extends HomeBaseController
- {
- //供应商账号登录
- public function login()
- {
- $param = $this->request->filter('trim')->only(['mobile', 'password'], 'post');
- $val = Validate::rule(Config::get('validate_rules.login'));
- if (!$val->check($param)) return json_show(1004, $val->getError());
- return AccountLogic::login($param);
- }
- //获取用户信息
- public function getUserInfo()
- {
- $param = $this->request->filter('trim')->only(['token'], 'post');
- $val = Validate::rule(['token|用户token' => 'require|length:40|alphaNum']);
- if (!$val->check($param)) return json_show(1004, $val->getError());
- return AccountLogic::getUserInfo($param['token']);
- }
- }
|