Authored by hf

Merge branch 'develop' into test

... ... @@ -76,33 +76,17 @@ class LoginData
}
/**
* 写入SESSION会话
* 登出SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function signinSession($uid)
public static function signoutSession($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);
}
}
... ...
... ... @@ -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);
}
}
... ...
... ... @@ -44,22 +44,22 @@
<a class="type-item" href="/home/order?type=2">
<span class="iconfont">&#xe634;</span>
<br>待付款
{{#if pendingPaymentCount}}
<span class="num">{{pendingPaymentCount}}</span>
{{#if wait_pay_num}}
<span class="num">{{wait_pay_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=3">
<span class="iconfont">&#xe63b;</span>
<br>待发货
{{#if dueOutGoodsCount}}
<span class="num">{{dueOutGoodsCount}}</span>
{{#if wait_cargo_num}}
<span class="num">{{wait_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=4">
<span class="iconfont">&#xe633;</span>
<br>待收货
{{#if dueInGoodsCount}}
<span class="num">{{dueInGoodsCount}}</span>
{{#if send_cargo_num}}
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
</div>
... ...
... ... @@ -62,10 +62,9 @@ class UserModel
'brand_favorite_total',
'product_favorite_total',
'product_browse',
'dueInGoodsCount',
'dueOutGoodsCount',
'pendingPaymentCount',
'refundGoodsCount'
'send_cargo_num',
'wait_cargo_num',
'wait_pay_num',
);
foreach ($infoNumData['data'] as $key => &$val) {
... ...
... ... @@ -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);
... ...
... ... @@ -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"
... ...