Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
5056fa96
Commit
5056fa96
authored
Dec 17, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户权限
parent
3a8db323
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
Admin.php
common/models/Admin.php
+3
-3
User.php
common/models/User.php
+2
-2
UserController.php
wallet/controllers/UserController.php
+6
-0
No files found.
common/models/Admin.php
View file @
5056fa96
...
...
@@ -26,7 +26,7 @@ use yii\web\IdentityInterface;
*/
class
Admin
extends
\common\modelsgii\Admin
implements
IdentityInterface
{
const
STATUS_DELETED
=
0
;
const
STATUS_DELETED
=
2
;
const
STATUS_ACTIVE
=
1
;
/**
...
...
@@ -34,7 +34,7 @@ class Admin extends \common\modelsgii\Admin implements IdentityInterface
*/
public
static
function
findIdentity
(
$uid
)
{
return
static
::
find
()
->
where
([
'uid'
=>
$uid
,
'status'
=>
self
::
STATUS_ACTIVE
])
->
one
();
return
static
::
find
()
->
where
([
'uid'
=>
$uid
])
->
one
();
}
/**
...
...
@@ -45,7 +45,7 @@ class Admin extends \common\modelsgii\Admin implements IdentityInterface
*/
public
static
function
findByUsername
(
$username
)
{
return
static
::
findOne
([
'username'
=>
$username
,
'status'
=>
self
::
STATUS_ACTIVE
]);
return
static
::
findOne
([
'username'
=>
$username
]);
}
/**
...
...
common/models/User.php
View file @
5056fa96
...
...
@@ -23,8 +23,8 @@ use yii\web\IdentityInterface;
*/
class
User
extends
ActiveRecord
implements
IdentityInterface
{
const
STATUS_DELETED
=
0
;
const
STATUS_ACTIVE
=
1
0
;
const
STATUS_DELETED
=
2
;
const
STATUS_ACTIVE
=
1
;
const
AUTH_SUPER
=
'administrator'
;
...
...
wallet/controllers/UserController.php
View file @
5056fa96
...
...
@@ -34,6 +34,12 @@ class UserController extends BaseController
$code
=
-
1
;
goto
doEnd
;
}
if
(
Admin
::
STATUS_DELETED
==
$user
->
status
)
{
$msg
=
'用户已停用'
;
$data
=
null
;
$code
=
-
1
;
goto
doEnd
;
}
$token
=
[
'iss'
=>
'https://www.bitfeel.cn'
,
//签发者 可选
'aud'
=>
'https://www.bitfeel.cn'
,
//接收该JWT的一方,可选
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment