FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/apps/controllers/User.php at master · feter/framework · GitHub
feter
framework
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
apps
/
controllers
/
User.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (46 loc) · 1.04 KB
Breadcrumbs
framework
/
apps
/
controllers
/
User.php
Copy path
File metadata and controls
50 lines (46 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
namespace
App
\
Controller
;
use
Swoole
;
class
User
extends
Swoole
\Controller
{
function
login
()
{
//使用crypt密码
Swoole
\Auth::
$
password_hash
=
Swoole
\Auth::
HASH_CRYPT
;
$
this
->
session
->
start
();
//已经登录了,跳转到
if
(
$
this
->
user
->
isLogin
())
{
$
this
->
http
->
redirect
(
'
/user/home/
'
);
return
;
}
if
(!
empty
(
$
_POST
[
'
password
'
]))
{
$
r
=
$
this
->
user
->
login
(
trim
(
$
_POST
[
'
username
'
]),
$
_POST
[
'
password
'
]);
if
(
$
r
)
{
$
this
->
http
->
redirect
(
'
/user/home/
'
);
return
;
}
else
{
echo
"
登录失败
"
;
}
}
else
{
$
this
->
display
(
'
user/login.php
'
);
}
}
function
home
()
{
$
this
->
session
->
start
();
var_dump
(
$
_SESSION
);
Swoole
\Auth::
loginRequire
();
}
function
logout
()
{
$
this
->
session
->
start
();
$
this
->
user
->
logout
();
}
}
Back
|
FazBrowse Home
|
New Git URL