Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
newshop
newShopBack
Commits
8f56d04f
Commit
8f56d04f
authored
Nov 06, 2019
by
郭勇志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shop_rbac_user model修改
parent
9f2f0cbc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
BaseController.php
backend/controllers/v1/BaseController.php
+2
-2
LoginForm.php
backend/models/v1/user/LoginForm.php
+5
-4
ShopRbacUser.php
backend/models/v1/user/ShopRbacUser.php
+6
-7
No files found.
backend/controllers/v1/BaseController.php
View file @
8f56d04f
...
@@ -20,7 +20,7 @@ use backend\components\v1\authorizationFilter;
...
@@ -20,7 +20,7 @@ use backend\components\v1\authorizationFilter;
* ),
* ),
* @OA\Server(
* @OA\Server(
* description="Api server",
* description="Api server",
* url="/guoyongzhi
1
/weiShopNew",
* url="/guoyongzhi/weiShopNew",
* ),
* ),
* @OA\SecurityScheme(
* @OA\SecurityScheme(
* securityScheme="Authorization",
* securityScheme="Authorization",
...
@@ -44,7 +44,7 @@ class BaseController extends ActiveController
...
@@ -44,7 +44,7 @@ class BaseController extends ActiveController
'Access-Control-Request-Method'
=>
[
'GET'
,
'POST'
,
'PUT'
,
'PATCH'
,
'DELETE'
,
'HEAD'
,
'OPTIONS'
],
'Access-Control-Request-Method'
=>
[
'GET'
,
'POST'
,
'PUT'
,
'PATCH'
,
'DELETE'
,
'HEAD'
,
'OPTIONS'
],
'Access-Control-Request-Headers'
=>
[
'*'
],
'Access-Control-Request-Headers'
=>
[
'*'
],
'Access-Control-Allow-Credentials'
=>
true
,
'Access-Control-Allow-Credentials'
=>
true
,
'Access-Control-Max-Age'
=>
864
00
,
'Access-Control-Max-Age'
=>
36
00
,
'Access-Control-Expose-Headers'
=>
[
'*'
],
'Access-Control-Expose-Headers'
=>
[
'*'
],
],
],
]
]
...
...
backend/models/v1/user/LoginForm.php
View file @
8f56d04f
...
@@ -4,6 +4,7 @@ namespace backend\models\v1\user;
...
@@ -4,6 +4,7 @@ namespace backend\models\v1\user;
use
Yii
;
use
Yii
;
use
yii\base\Model
;
use
yii\base\Model
;
use
app\models\v1\user\ShopRbacUser
;
use
app\models\v1\user\ShopRbacUser
;
use
yii\web\HttpException
;
/**
/**
* Login form
* Login form
...
@@ -56,11 +57,11 @@ class LoginForm extends Model
...
@@ -56,11 +57,11 @@ class LoginForm extends Model
if
(
$this
->
validate
())
{
if
(
$this
->
validate
())
{
$accessToken
=
$this
->
_shopRbacUser
->
generateAccessToken
();
$accessToken
=
$this
->
_shopRbacUser
->
generateAccessToken
();
// 生成的access_token保存一份到mysql和redis中
// 生成的access_token保存一份到mysql和redis中
var_dump
(
$this
->
_shopRbacUser
);
exit
;
if
(
$this
->
_shopRbacUser
->
save
())
{
$this
->
_shopRbacUser
->
save
();
return
$accessToken
;
return
$accessToken
;
}
}
throw
new
HttpException
(
'400'
,
'登陆失败'
);
}
return
false
;
return
false
;
}
}
...
...
backend/models/v1/user/ShopRbacUser.php
View file @
8f56d04f
...
@@ -25,10 +25,10 @@ use yii\web\IdentityInterface;
...
@@ -25,10 +25,10 @@ use yii\web\IdentityInterface;
* @property int $CONTACTSEX 性别,1:男,0:女
* @property int $CONTACTSEX 性别,1:男,0:女
* @property string $DESCRIPTION 用户头像URL
* @property string $DESCRIPTION 用户头像URL
* @property string $USER_GUID 大平台USERGUID,普通用户此信息为空
* @property string $USER_GUID 大平台USERGUID,普通用户此信息为空
* @property
string
$IS_UPLOAD_HX 是否上传华信,1:是
* @property
int
$IS_UPLOAD_HX 是否上传华信,1:是
* @property int $IS_BELONG 是否员工,1:是
* @property int $IS_BELONG 是否员工,1:是
* @property string $REMARK 备注
* @property string $REMARK 备注
* @property string $ALIPAY_UID
是否员工,1:是
* @property string $ALIPAY_UID
阿里payid
* @property string $WX_UNIONID 小程序UNIONID
* @property string $WX_UNIONID 小程序UNIONID
* @property string $WX_OPENID 小程序OPENID
* @property string $WX_OPENID 小程序OPENID
* @property int $AGE 年龄
* @property int $AGE 年龄
...
@@ -51,14 +51,12 @@ class ShopRbacUser extends ActiveRecord implements IdentityInterface
...
@@ -51,14 +51,12 @@ class ShopRbacUser extends ActiveRecord implements IdentityInterface
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'GUID'
,
'CODE'
],
'required'
,
'message'
=>
'账号密码不能为空'
],
[[
'GUID'
,
'CODE'
],
'required'
],
[[
'CREATE_DATE'
,
'UPDATE_DATE'
],
'safe'
],
[[
'CREATE_DATE'
,
'UPDATE_DATE'
],
'safe'
],
[[
'IS_FORBID'
,
'CONTACTSEX'
,
'IS_BELONG'
,
'AGE'
],
'integer'
],
[[
'IS_FORBID'
,
'CONTACTSEX'
,
'IS_UPLOAD_HX'
,
'IS_BELONG'
,
'AGE'
],
'integer'
],
[[
'GUID'
,
'CODE'
,
'PASSWORD'
,
'ORG_GUID'
,
'EMPLOYEE_GUID'
,
'CREATE_GUID'
,
'UPDATE_GUID'
,
'MOBILEPHONE'
,
'USER_GUID'
,
'REMARK'
,
'ALIPAY_UID'
,
'WX_UNIONID'
,
'WX_OPENID'
,
'SHARE_NO'
],
'string'
,
'max'
=>
50
],
[[
'GUID'
,
'CODE'
,
'PASSWORD'
,
'ORG_GUID'
,
'EMPLOYEE_GUID'
,
'CREATE_GUID'
,
'UPDATE_GUID'
,
'MOBILEPHONE'
,
'USER_GUID'
,
'REMARK'
,
'ALIPAY_UID'
,
'WX_UNIONID'
,
'WX_OPENID'
,
'SHARE_NO'
,
'ACCESS_TOKEN'
],
'string'
,
'max'
=>
50
],
[[
'PASSWORD'
],
'required'
,
'message'
=>
'账号密码不能为空'
],
[[
'NAME'
,
'CREATE_NAME'
,
'UPDATE_NAME'
],
'string'
,
'max'
=>
100
],
[[
'NAME'
,
'CREATE_NAME'
,
'UPDATE_NAME'
],
'string'
,
'max'
=>
100
],
[[
'DESCRIPTION'
],
'string'
,
'max'
=>
255
],
[[
'DESCRIPTION'
],
'string'
,
'max'
=>
255
],
[[
'IS_UPLOAD_HX'
],
'string'
,
'max'
=>
10
],
[[
'GUID'
],
'unique'
],
[[
'GUID'
],
'unique'
],
];
];
}
}
...
@@ -94,6 +92,7 @@ class ShopRbacUser extends ActiveRecord implements IdentityInterface
...
@@ -94,6 +92,7 @@ class ShopRbacUser extends ActiveRecord implements IdentityInterface
'WX_OPENID'
=>
'Wx Openid'
,
'WX_OPENID'
=>
'Wx Openid'
,
'AGE'
=>
'Age'
,
'AGE'
=>
'Age'
,
'SHARE_NO'
=>
'Share No'
,
'SHARE_NO'
=>
'Share No'
,
'ACCESS_TOKEN'
=>
'Access Token'
,
];
];
}
}
/**
/**
...
...
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