Commit 2bfd630d5f3526ce5c0f05fadc420e1e8f1a919e
1 parent
810ae410
[留言板]后台登录接口
Showing
1 changed file
with
52 additions
and
0 deletions
trunk/Message/Apicp/Controller/Message/LoginController.class.php
0 → 100644
1 | +<?php | |
2 | +/** | |
3 | + * User: <362431947@qq.com> | |
4 | + * Date: 2018-10-12 Time: 18:18 | |
5 | + */ | |
6 | +namespace Apicp\Controller\Message; | |
7 | + | |
8 | +use Common\Model\PersonModel; | |
9 | + | |
10 | +class LoginController extends \Apicp\Controller\AbstractController | |
11 | +{ | |
12 | + /** | |
13 | + * 不强制指定系统登录 | |
14 | + */ | |
15 | + protected $_require_login = false; | |
16 | + | |
17 | + /** | |
18 | + * 留言板模块|用户登录 | |
19 | + * @author <362431947@qq.com> | |
20 | + * @date 2018-10-09 | |
21 | + */ | |
22 | + public function Index_post() | |
23 | + { | |
24 | + $input = I('post.'); | |
25 | + | |
26 | + if(! $input){ | |
27 | + E('_ERR_POST_EMPTY'); | |
28 | + } | |
29 | + | |
30 | + $name = $input['name']; | |
31 | + $pwd = $input['pwd']; | |
32 | + | |
33 | + if(! $name || ! $pwd){ | |
34 | + E('_ERROR_LOGIN_EMPTY'); | |
35 | + } | |
36 | + | |
37 | + $conds = [ | |
38 | + 'name'=>$name, | |
39 | + 'pwd' =>md5($pwd), | |
40 | + ]; | |
41 | + | |
42 | + $m_person = new PersonModel(); | |
43 | + $user_info = $m_person->getUserByConds($conds); | |
44 | + | |
45 | + $auth_login = false; | |
46 | + if($user_info){ | |
47 | + $auth_login = true; | |
48 | + } | |
49 | + | |
50 | + $this->_result = $auth_login; | |
51 | + } | |
52 | +} | |
0 | 53 | \ No newline at end of file | ... | ... |