Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
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
chenchuanwen
my-yaf-project
Commits
c35a04e3
Commit
c35a04e3
authored
Oct 30, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
a8b38774
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
282 additions
and
226 deletions
+282
-226
AbstractClient.php
application/library/Our/Controller/AbstractClient.php
+55
-0
Shopkeeper.php
application/modules/Client/controllers/Shopkeeper.php
+226
-226
User.php
application/modules/Client/controllers/User.php
+1
-0
No files found.
application/library/Our/Controller/AbstractClient.php
0 → 100644
View file @
c35a04e3
<?php
namespace
Our
;
use
Business\User\MemberServiceModel
;
use
Error\CodeConfigModel
;
use
Error\ErrorModel
;
/**
* api模块控制器抽象类
*
* @package Our
* @author iceup <sjlinyu@qq.com>
*/
abstract
class
Controller_AbstractClient
extends
\Our\Controller_Abstract
{
public
$config
;
public
$redis
;
public
$key
;
public
$req
;
public
$memberId
;
/**
* api控制器直接输出json格式数据,不需要渲染视图
*/
public
function
init
()
{
$this
->
req
=
$this
->
getRequest
()
->
getPost
();
$this
->
checkEncrypt
();
if
(
empty
(
$this
->
req
[
'data'
][
'key'
])){
ErrorModel
::
throwException
(
CodeConfigModel
::
illegalAccess
);
}
session_id
(
$this
->
req
[
'data'
][
'key'
]);
// ini_set('session.gc_maxlifetime', ApiConst::tenDaySecond);
$sess
=
\Yaf\Session
::
getInstance
();
$sess
->
start
();
$this
->
memberId
=
$sess
->
get
(
'member_id'
);
$this
->
storeId
=
$sess
->
get
(
'store_id'
);
if
(
empty
(
$this
->
memberId
)){
ErrorModel
::
throwException
(
CodeConfigModel
::
noLogin
);
}
if
(
isset
(
$sess
[
'other_login'
])
&&
$sess
[
'other_login'
]
==
ApiConst
::
one
){
$memberService
=
MemberServiceModel
::
getInstance
();
$memberService
->
clearKey
(
$this
->
req
[
'data'
][
'key'
]);
ErrorModel
::
throwException
(
CodeConfigModel
::
otherDriverLogin
);
}
\Yaf\Dispatcher
::
getInstance
()
->
disableView
();
}
public
function
getAuthKey
(){
$this
->
key
=
Common
::
bulidToken
();
$this
->
redis
->
hset
(
$this
->
key
,
NameConst
::
sessionKey
,
$this
->
key
,
ApiConst
::
tenMin
);
}
public
function
loginCheck
(){
}
}
application/modules/Client/controllers/Shopkeeper.php
View file @
c35a04e3
This diff is collapsed.
Click to expand it.
application/modules/Client/controllers/User.php
View file @
c35a04e3
...
@@ -63,6 +63,7 @@ class UserController extends \Our\Controller_AbstractIndex {
...
@@ -63,6 +63,7 @@ class UserController extends \Our\Controller_AbstractIndex {
$this
->
key
=
Common
::
bulidToken
(
$mobile
,
$password
);
$this
->
key
=
Common
::
bulidToken
(
$mobile
,
$password
);
session_id
(
$this
->
key
);
session_id
(
$this
->
key
);
$this
->
sess
[
'member_id'
]
=
(
int
)
$member
[
'member_id'
];
$this
->
sess
[
'member_id'
]
=
(
int
)
$member
[
'member_id'
];
$this
->
sess
[
'store_id'
]
=
(
int
)
$seller
[
'storeId'
];
$this
->
sess
[
NameConst
::
sessionKey
]
=
$this
->
key
;
$this
->
sess
[
NameConst
::
sessionKey
]
=
$this
->
key
;
$member
[
NameConst
::
sessionKey
]
=
$this
->
key
;
$member
[
NameConst
::
sessionKey
]
=
$this
->
key
;
$member
[
'store_id'
]
=
$seller
[
'storeId'
];
$member
[
'store_id'
]
=
$seller
[
'storeId'
];
...
...
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