do modify huodong cuxiao coupon page 2 brands links
Showing
5 changed files
with
58 additions
and
20 deletions
@@ -32,6 +32,7 @@ class Yohobuy | @@ -32,6 +32,7 @@ class Yohobuy | ||
32 | const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL | 32 | const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL |
33 | const API_URL_PRODUCTDETAIL = 'http://192.168.102.212:8083/product/'; // 商品详情页 | 33 | const API_URL_PRODUCTDETAIL = 'http://192.168.102.212:8083/product/'; // 商品详情页 |
34 | const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL | 34 | const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL |
35 | + const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/'; | ||
35 | 36 | ||
36 | /** | 37 | /** |
37 | * 私钥列表 | 38 | * 私钥列表 |
1 | <?php | 1 | <?php |
2 | + | ||
2 | namespace LibModels\Wap\Passport; | 3 | namespace LibModels\Wap\Passport; |
3 | 4 | ||
4 | use Api\Sign; | 5 | use Api\Sign; |
@@ -15,7 +16,7 @@ use Api\Yohobuy; | @@ -15,7 +16,7 @@ use Api\Yohobuy; | ||
15 | */ | 16 | */ |
16 | class LoginData | 17 | class LoginData |
17 | { | 18 | { |
18 | - | 19 | + |
19 | /** | 20 | /** |
20 | * 登录 | 21 | * 登录 |
21 | * | 22 | * |
@@ -32,10 +33,10 @@ class LoginData | @@ -32,10 +33,10 @@ class LoginData | ||
32 | $param['profile'] = $profile; | 33 | $param['profile'] = $profile; |
33 | $param['password'] = $password; | 34 | $param['password'] = $password; |
34 | $param['client_secret'] = Sign::getSign($param); | 35 | $param['client_secret'] = Sign::getSign($param); |
35 | - | 36 | + |
36 | return Yohobuy::post(Yohobuy::API_URL, $param); | 37 | return Yohobuy::post(Yohobuy::API_URL, $param); |
37 | } | 38 | } |
38 | - | 39 | + |
39 | /** | 40 | /** |
40 | * 用户信息 | 41 | * 用户信息 |
41 | * | 42 | * |
@@ -48,7 +49,7 @@ class LoginData | @@ -48,7 +49,7 @@ class LoginData | ||
48 | $param['method'] = 'app.passport.profile'; | 49 | $param['method'] = 'app.passport.profile'; |
49 | $param['uid'] = $uid; | 50 | $param['uid'] = $uid; |
50 | $param['client_secret'] = Sign::getSign($param); | 51 | $param['client_secret'] = Sign::getSign($param); |
51 | - | 52 | + |
52 | return Yohobuy::get(Yohobuy::API_URL, $param); | 53 | return Yohobuy::get(Yohobuy::API_URL, $param); |
53 | } | 54 | } |
54 | 55 | ||
@@ -68,7 +69,38 @@ class LoginData | @@ -68,7 +69,38 @@ class LoginData | ||
68 | $param['openId'] = $openId; | 69 | $param['openId'] = $openId; |
69 | $param['source_type'] = $sourceType; | 70 | $param['source_type'] = $sourceType; |
70 | $param['client_secret'] = Sign::getSign($param); | 71 | $param['client_secret'] = Sign::getSign($param); |
71 | - | 72 | + |
72 | return Yohobuy::get(Yohobuy::API_URL, $param); | 73 | return Yohobuy::get(Yohobuy::API_URL, $param); |
73 | } | 74 | } |
75 | + | ||
76 | + /** | ||
77 | + * 写入SESSION会话 | ||
78 | + * | ||
79 | + * @param int $uid 用户ID | ||
80 | + * @return array | ||
81 | + */ | ||
82 | + public static function signinSession($uid) | ||
83 | + { | ||
84 | + $param = array(); | ||
85 | + $param['uid'] = $uid; | ||
86 | + $param['token'] = md5($uid . '#@!@#'); | ||
87 | + | ||
88 | + return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/index', $param); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 写入SESSION会话 | ||
93 | + * | ||
94 | + * @param int $uid 用户ID | ||
95 | + * @return array | ||
96 | + */ | ||
97 | + public static function checkSession($uid) | ||
98 | + { | ||
99 | + $param = array(); | ||
100 | + $param['uid'] = $uid; | ||
101 | + $param['token'] = md5($uid . '#@!@#'); | ||
102 | + | ||
103 | + return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/val', $param); | ||
104 | + } | ||
105 | + | ||
74 | } | 106 | } |
@@ -31,9 +31,17 @@ class DetailData | @@ -31,9 +31,17 @@ class DetailData | ||
31 | */ | 31 | */ |
32 | public static function baseInfo($productId, $uid) | 32 | public static function baseInfo($productId, $uid) |
33 | { | 33 | { |
34 | - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array( | ||
35 | - 'param' => intval($productId), 'userId' => intval($uid) | ||
36 | - )); | 34 | + $param = Yohobuy::param(); |
35 | + $param['method'] = 'h5.product.data'; | ||
36 | + $param['product_id'] = $productId; | ||
37 | + $param['uid'] = $uid; | ||
38 | + $param['client_secret'] = Sign::getSign($param); | ||
39 | + | ||
40 | + return Yohobuy::post(Yohobuy::API_URL, $param); | ||
41 | + | ||
42 | +// return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array( | ||
43 | +// 'param' => intval($productId), 'userId' => intval($uid) | ||
44 | +// )); | ||
37 | } | 45 | } |
38 | 46 | ||
39 | /** | 47 | /** |
@@ -19,6 +19,9 @@ class LoginController extends AbstractAction | @@ -19,6 +19,9 @@ class LoginController extends AbstractAction | ||
19 | { | 19 | { |
20 | $this->setTitle('登录'); | 20 | $this->setTitle('登录'); |
21 | 21 | ||
22 | + $refer = $this->get('refer', SITE_MAIN . '/?go=1'); | ||
23 | + $this->setCookie('refer', $refer); | ||
24 | + | ||
22 | $data = array( | 25 | $data = array( |
23 | 'loginIndex' => true, // 模板中使用JS的标识 | 26 | 'loginIndex' => true, // 模板中使用JS的标识 |
24 | 'backUrl' => '/', // 返回的URL链接 | 27 | 'backUrl' => '/', // 返回的URL链接 |
@@ -33,8 +36,6 @@ class LoginController extends AbstractAction | @@ -33,8 +36,6 @@ class LoginController extends AbstractAction | ||
33 | 'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接 | 36 | 'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接 |
34 | ); | 37 | ); |
35 | 38 | ||
36 | - // 生成HTML(signin.html) | ||
37 | - $this->_view->html('signin'); | ||
38 | // 渲染模板 | 39 | // 渲染模板 |
39 | $this->_view->display('index', $data); | 40 | $this->_view->display('index', $data); |
40 | } | 41 | } |
@@ -53,13 +54,11 @@ class LoginController extends AbstractAction | @@ -53,13 +54,11 @@ class LoginController extends AbstractAction | ||
53 | $data['isPassportPage'] = true; // 模板中模块标识 | 54 | $data['isPassportPage'] = true; // 模板中模块标识 |
54 | $data['areaCode'] = '+86'; // 默认区号 | 55 | $data['areaCode'] = '+86'; // 默认区号 |
55 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 | 56 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 |
56 | - // | ||
57 | - // 生成HTML(login.html) | ||
58 | - $this->_view->html('login'); | 57 | + |
59 | // 渲染模板 | 58 | // 渲染模板 |
60 | $this->_view->display('international', $data); | 59 | $this->_view->display('international', $data); |
61 | } | 60 | } |
62 | - | 61 | + |
63 | /** | 62 | /** |
64 | * 退出 | 63 | * 退出 |
65 | * | 64 | * |
@@ -68,7 +67,7 @@ class LoginController extends AbstractAction | @@ -68,7 +67,7 @@ class LoginController extends AbstractAction | ||
68 | public function outAction() | 67 | public function outAction() |
69 | { | 68 | { |
70 | $this->setCookie('_UID', ''); | 69 | $this->setCookie('_UID', ''); |
71 | - | 70 | + |
72 | headers_sent() || header('Location: /'); | 71 | headers_sent() || header('Location: /'); |
73 | } | 72 | } |
74 | 73 | ||
@@ -124,8 +123,7 @@ class LoginController extends AbstractAction | @@ -124,8 +123,7 @@ class LoginController extends AbstractAction | ||
124 | // $name = $profile['data']['mobile']; | 123 | // $name = $profile['data']['mobile']; |
125 | // } | 124 | // } |
126 | $data['data'] = '/'; // @todo | 125 | $data['data'] = '/'; // @todo |
127 | - } | ||
128 | - while (false); | 126 | + } while (false); |
129 | 127 | ||
130 | $this->echoJson($data); | 128 | $this->echoJson($data); |
131 | } | 129 | } |
@@ -188,8 +186,7 @@ class LoginController extends AbstractAction | @@ -188,8 +186,7 @@ class LoginController extends AbstractAction | ||
188 | $nickname = $userInfo['response']['user_info']['user_name']; | 186 | $nickname = $userInfo['response']['user_info']['user_name']; |
189 | // $alipayEmail = $userInfo['response']['user_info']['email']; | 187 | // $alipayEmail = $userInfo['response']['user_info']['email']; |
190 | } | 188 | } |
191 | - } | ||
192 | - else { | 189 | + } else { |
193 | $nickname = $_GET['real_name']; | 190 | $nickname = $_GET['real_name']; |
194 | // $alipayEmail = isset($_GET['email']) ? $_GET['email'] : ''; | 191 | // $alipayEmail = isset($_GET['email']) ? $_GET['email'] : ''; |
195 | } | 192 | } |
@@ -272,7 +272,7 @@ class RegController extends AbstractAction | @@ -272,7 +272,7 @@ class RegController extends AbstractAction | ||
272 | if (empty($refer)) { | 272 | if (empty($refer)) { |
273 | $refer = SITE_MAIN . '/?go=1'; | 273 | $refer = SITE_MAIN . '/?go=1'; |
274 | } | 274 | } |
275 | - $data['data'] = $refer; | 275 | + $data['data'] = rawurldecode($refer); |
276 | } | 276 | } |
277 | 277 | ||
278 | } while (false); | 278 | } while (false); |
-
Please register or login to post a comment