Default.class.php
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* 默认控制器
*/
class Controller_Default extends Controller_Abstract
{
public function init()
{
}
/**
* 首页
*/
public function indexAction()
{
//连接数据库测试
Facade_Userinfo::getUserinfoByUid(1);
return "Run....";
}
public function testAction()
{
$uid = Facade_Auth::getAuthedUid();
if ($uid)
{
dump( Facade_Userinfo::getUserinfoByUid($uid) );
}else
{
echo "尚未登录";
}
}
public function loginAction()
{
$accounts = array
(
'jsnjmayangda@163.com',
'jsnjmayaangda@163.com',
'jsnjmayaadngda@163.com',
'jsnjmayaadngdda@163.com',
'jsnjmayaadndgdda@163.com',
'jsnjmayaaddndgdda@163.com',
'jsnjmayaadddndgdda@163.com',
'jsnjmayaadaddndgdda@163.com',
'jsnjmayaadadddndgdda@163.com',
'jsnjmaayaadadddndgdda@163.com',
'jsnjmaayaadadddndagdda@163.com',
'demo@163.com',
'demo20@163.com',
'demo21@163.com',
'demo22@163.com',
'demo23@163.com',
'demotest@163.com',
'demotest3@163.com',
'demotest10@163.com',
'demotest11@163.com',
'login@163.com',
);
$account = array_rand($accounts);
$account = $accounts[$account];
$password = '123456';
$result = Facade_Auth::checkLogin($account, $password) ;
if (isset($result['uid']))
{
//构造信息返回
$data = Facade_Userinfo::getUserinfoForApp($result['uid'],$fields, $this->_appScope);
if (!isset($data['uid']))
{
$data['uid'] = $result['uid'];
}
return $this->returnJson($result['code'], $data,$result['message']);
}
return $this->returnJson($result['code'], array(), $result['message']);
}
}