union_data 参数 json_decode 单独独立出来
Showing
1 changed file
with
6 additions
and
2 deletions
@@ -691,13 +691,17 @@ class IndexController extends AbstractAction | @@ -691,13 +691,17 @@ class IndexController extends AbstractAction | ||
691 | } else { | 691 | } else { |
692 | $unionKey = AuthCode::decode($_COOKIE['_QYH_UNION'], 'q_union_yohobuy'); | 692 | $unionKey = AuthCode::decode($_COOKIE['_QYH_UNION'], 'q_union_yohobuy'); |
693 | } | 693 | } |
694 | + | ||
695 | + /* 检查联盟参数是否有效 */ | ||
696 | + $unionInfo = empty($unionKey) ? array() : json_decode($unionKey, true); | ||
694 | } else { | 697 | } else { |
695 | $unionKey = '{"client_id":' . $_COOKIE['mkt_code'] . | 698 | $unionKey = '{"client_id":' . $_COOKIE['mkt_code'] . |
696 | (empty($_COOKIE['union_data']) ? '' : ',"union_data":' . $_COOKIE['union_data']) . '}'; | 699 | (empty($_COOKIE['union_data']) ? '' : ',"union_data":' . $_COOKIE['union_data']) . '}'; |
700 | + | ||
701 | + /* 检查联盟参数是否有效 */ | ||
702 | + $unionInfo = json_decode('{"client_id":' . $_COOKIE['mkt_code'] . '}', true); | ||
697 | } | 703 | } |
698 | 704 | ||
699 | - /* 检查联盟参数是否有效 */ | ||
700 | - $unionInfo = empty($unionKey) ? array() : json_decode($unionKey, true); | ||
701 | /* 模拟APP的User-Agent */ | 705 | /* 模拟APP的User-Agent */ |
702 | $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null; | 706 | $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null; |
703 | 707 |
-
Please register or login to post a comment