Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
cd76b4d3209b7d0d6e7f7220723ff92283d0e924
1 parent
2b6a8d15
do fixes bug to partner login bugs
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
30 deletions
library/LibModels/Wap/Passport/LoginData.php
library/Plugin/Partner/sinaweibo/Call.php
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
yohobuy/m.yohobuy.com/configs/routes.index.ini
library/LibModels/Wap/Passport/LoginData.php
View file @
cd76b4d
...
...
@@ -76,33 +76,17 @@ class LoginData
}
/**
*
写入
SESSION会话
*
登出
SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public
static
function
sign
inSession
(
$uid
)
public
static
function
sign
outSession
(
$token
)
{
$param
=
array
();
$param
[
'uid'
]
=
$uid
;
$param
[
'token'
]
=
md5
(
$uid
.
'#@!@#'
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL_LOGINSESSION
.
'Passport/session/index'
,
$param
);
}
/**
* 写入SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public
static
function
checkSession
(
$uid
)
{
$param
=
array
();
$param
[
'uid'
]
=
$uid
;
$param
[
'token'
]
=
md5
(
$uid
.
'#@!@#'
);
$param
[
'token'
]
=
$token
;
return
Yohobuy
::
get
(
Yohobuy
::
API_URL_LOGINSESSION
.
'Passport/session/
val
'
,
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL_LOGINSESSION
.
'Passport/session/
logout
'
,
$param
);
}
}
...
...
library/Plugin/Partner/sinaweibo/Call.php
View file @
cd76b4d
...
...
@@ -77,7 +77,7 @@ class Call extends Factory
if
(
is_array
(
$token
)
&&
isset
(
$token
[
'uid'
]))
{
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$userInfo
=
$this
->
client
->
show_user_by_id
(
$token
[
'uid'
]);
...
...
@@ -108,7 +108,7 @@ class Call extends Factory
if
(
is_array
(
$token
)
&&
isset
(
$token
[
'access_token'
]))
{
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$result
=
$this
->
client
->
friends_by_id
(
$params
[
'uid'
],
$params
[
'cursor'
],
$params
[
'count'
]);
...
...
@@ -133,7 +133,7 @@ class Call extends Factory
if
(
is_array
(
$token
)
&&
isset
(
$token
[
'access_token'
]))
{
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$result
=
$this
->
client
->
bilateral
(
$params
[
'uid'
],
$params
[
'page'
],
$params
[
'count'
]);
...
...
@@ -163,7 +163,7 @@ class Call extends Factory
{
$content
.=
$link
;
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$response
=
$this
->
client
->
upload
(
$content
,
$image
);
...
...
@@ -190,7 +190,7 @@ class Call extends Factory
if
(
is_array
(
$token
)
&&
isset
(
$token
[
'access_token'
]))
{
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
if
(
$uid
!==
null
)
{
...
...
@@ -218,7 +218,7 @@ class Call extends Factory
if
(
is_array
(
$token
)
&&
isset
(
$token
[
'access_token'
])
&&
is_string
(
$content
))
{
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
->
update
(
$content
);
}
...
...
@@ -238,7 +238,7 @@ class Call extends Factory
{
if
(
is_array
(
$token
)
&&
isset
(
$token
[
'access_token'
])
&&
isset
(
$uid
))
{
$this
->
client
=
new
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
=
new
\
SaeTClientV2
(
$this
->
apiConfig
[
'appId'
],
$this
->
apiConfig
[
'appKey'
],
$token
[
'access_token'
]);
$this
->
client
->
send_dm_by_id
(
$uid
,
$content
,
$id
);
}
}
...
...
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
View file @
cd76b4d
...
...
@@ -16,7 +16,7 @@ class LoginController extends AbstractAction
* 登录页
*/
public
function
indexAction
()
{
{
$this
->
setTitle
(
'登录'
);
$refer
=
$this
->
get
(
'refer'
);
...
...
@@ -67,14 +67,15 @@ class LoginController extends AbstractAction
/**
* 退出
*
* @todo
*/
public
function
outAction
()
{
$this
->
setCookie
(
'_UID'
,
''
);
$refer
=
$this
->
server
(
'HTTP_REFERER'
,
SITE_MAIN
);
$token
=
$this
->
get
(
'token'
);
LoginData
::
signoutSession
(
$token
);
$this
->
go
(
$refer
);
}
...
...
@@ -126,6 +127,7 @@ class LoginController extends AbstractAction
}
$data
[
'data'
][
'session'
]
=
Helpers
::
syncUserSession
(
$data
[
'data'
][
'uid'
]);
$data
[
'data'
][
'href'
]
=
$refer
;
}
while
(
false
);
$this
->
echoJson
(
$data
);
...
...
yohobuy/m.yohobuy.com/configs/routes.index.ini
View file @
cd76b4d
...
...
@@ -40,6 +40,13 @@ routes.interational.route.module = Passport
routes.interational.route.controller
=
Login
routes.interational.route.action
=
International
; 登录页
routes.logout.type
=
"rewrite"
routes.logout.match
=
"/passport/signout/index"
routes.logout.route.module
=
Passport
routes.logout.route.controller
=
Login
routes.logout.route.action
=
out
; 找回密码(手机号)
routes.phoneback.type
=
"rewrite"
routes.phoneback.match
=
"/phoneback.html"
...
...
Please
register
or
login
to post a comment