1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace app\mobile\controller;
- use app\BaseController;
- use app\mobile\logic\AccountLogic;
- use think\exception\ValidateException;
- use think\facade\Config;
- use think\facade\Validate;
- //账户
- class Account extends BaseController
- {
- //登录
- public function login()
- {
- $param = $this->request->only(['username', 'password'], 'post');
- $val = Validate::rule(Config::get('validate_rules.login'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return AccountLogic::login($param);
- }
- //登出
- public function logout()
- {
- return AccountLogic::logout($this->request->post('token', ''));
- }
- //详情
- public function info(){
- return AccountLogic::info();
- }
- }
|