Showing
10 changed files
with
104 additions
and
32 deletions
@@ -20,6 +20,7 @@ use Hood\Session; | @@ -20,6 +20,7 @@ use Hood\Session; | ||
20 | use WebPlugin\Mobile; | 20 | use WebPlugin\Mobile; |
21 | use Api\Yohobuy; | 21 | use Api\Yohobuy; |
22 | use LibModels\Web\Passport\LoginData; | 22 | use LibModels\Web\Passport\LoginData; |
23 | +use WebPlugin\UdpLog; | ||
23 | 24 | ||
24 | class WebAction extends Controller_Abstract | 25 | class WebAction extends Controller_Abstract |
25 | { | 26 | { |
@@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract | @@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract | ||
383 | $token = Helpers::makeToken($uid); | 384 | $token = Helpers::makeToken($uid); |
384 | $uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token; | 385 | $uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token; |
385 | $this->setCookie('_UID',$uidCookie,time() + 86400 * 360); | 386 | $this->setCookie('_UID',$uidCookie,time() + 86400 * 360); |
387 | + UdpLog::info('【登录】同步登陆cookie生成',$uidCookie); | ||
386 | } | 388 | } |
387 | $this->setSession('_TOKEN', $token); | 389 | $this->setSession('_TOKEN', $token); |
388 | $this->setSession('_LOGIN_UID', $uid); | 390 | $this->setSession('_LOGIN_UID', $uid); |
@@ -402,7 +404,7 @@ class WebAction extends Controller_Abstract | @@ -402,7 +404,7 @@ class WebAction extends Controller_Abstract | ||
402 | if (!$this->_useSession) { | 404 | if (!$this->_useSession) { |
403 | $useSession = false; | 405 | $useSession = false; |
404 | } | 406 | } |
405 | - $useSession = false; | 407 | + //$useSession = false; |
406 | 408 | ||
407 | if (!$this->_uid) { | 409 | if (!$this->_uid) { |
408 | $cookie = $this->getCookie('_UID'); | 410 | $cookie = $this->getCookie('_UID'); |
@@ -95,7 +95,7 @@ class InfoData | @@ -95,7 +95,7 @@ class InfoData | ||
95 | */ | 95 | */ |
96 | public static function getArticleInfo($id, $onlyUrl = false) | 96 | public static function getArticleInfo($id, $onlyUrl = false) |
97 | { | 97 | { |
98 | - $param['article_id'] = $id; | 98 | + $param['article_id'] = intval($id); |
99 | return self::webApi(self::getUrl('getArticle'), $param, $onlyUrl); | 99 | return self::webApi(self::getUrl('getArticle'), $param, $onlyUrl); |
100 | } | 100 | } |
101 | 101 | ||
@@ -107,7 +107,7 @@ class InfoData | @@ -107,7 +107,7 @@ class InfoData | ||
107 | */ | 107 | */ |
108 | public static function author($authorId, $onlyUrl = false) | 108 | public static function author($authorId, $onlyUrl = false) |
109 | { | 109 | { |
110 | - $param['author_id'] = $authorId; | 110 | + $param['author_id'] = intval($authorId); |
111 | return self::webApi(self::getUrl('author'), $param, $onlyUrl); | 111 | return self::webApi(self::getUrl('author'), $param, $onlyUrl); |
112 | } | 112 | } |
113 | 113 | ||
@@ -121,8 +121,8 @@ class InfoData | @@ -121,8 +121,8 @@ class InfoData | ||
121 | 121 | ||
122 | public static function tagTop($page = 1,$limit = 10, $onlyUrl = false) | 122 | public static function tagTop($page = 1,$limit = 10, $onlyUrl = false) |
123 | { | 123 | { |
124 | - $param['page'] = $page; | ||
125 | - $param['limit'] = $limit; | 124 | + $param['page'] = intval($page); |
125 | + $param['limit'] = intval($limit); | ||
126 | return self::webApi(self::getUrl('getTagTop'), $param, $onlyUrl); | 126 | return self::webApi(self::getUrl('getTagTop'), $param, $onlyUrl); |
127 | } | 127 | } |
128 | 128 | ||
@@ -136,9 +136,9 @@ class InfoData | @@ -136,9 +136,9 @@ class InfoData | ||
136 | */ | 136 | */ |
137 | public static function comment($articleId, $page = 1, $limit = 10, $onlyUrl = false) | 137 | public static function comment($articleId, $page = 1, $limit = 10, $onlyUrl = false) |
138 | { | 138 | { |
139 | - $param['article_id'] = $articleId; | ||
140 | - $param['page'] = $page; | ||
141 | - $param['limit'] = $limit; | 139 | + $param['article_id'] = intval($articleId); |
140 | + $param['page'] = intval($page); | ||
141 | + $param['limit'] = intval($limit); | ||
142 | return self::webApi(self::getUrl('commentList'), $param, $onlyUrl); | 142 | return self::webApi(self::getUrl('commentList'), $param, $onlyUrl); |
143 | } | 143 | } |
144 | 144 | ||
@@ -150,7 +150,7 @@ class InfoData | @@ -150,7 +150,7 @@ class InfoData | ||
150 | */ | 150 | */ |
151 | public static function articleContent($articleId, $onlyUrl = false) | 151 | public static function articleContent($articleId, $onlyUrl = false) |
152 | { | 152 | { |
153 | - $param['article_id'] = $articleId; | 153 | + $param['article_id'] = intval($articleId); |
154 | return self::webApi(self::getUrl('getArticleContent'), $param, $onlyUrl); | 154 | return self::webApi(self::getUrl('getArticleContent'), $param, $onlyUrl); |
155 | } | 155 | } |
156 | 156 | ||
@@ -164,7 +164,7 @@ class InfoData | @@ -164,7 +164,7 @@ class InfoData | ||
164 | */ | 164 | */ |
165 | public static function baseInfo($articleId, $uid, $udid, $onlyUrl = false) | 165 | public static function baseInfo($articleId, $uid, $udid, $onlyUrl = false) |
166 | { | 166 | { |
167 | - $param['id'] = $articleId; | 167 | + $param['id'] = intval($articleId); |
168 | $param['uid'] = $uid; | 168 | $param['uid'] = $uid; |
169 | $param['udid'] = $udid; | 169 | $param['udid'] = $udid; |
170 | return self::webApi(self::getUrl('getArticleBaseInfo'), $param, $onlyUrl); | 170 | return self::webApi(self::getUrl('getArticleBaseInfo'), $param, $onlyUrl); |
@@ -178,7 +178,7 @@ class InfoData | @@ -178,7 +178,7 @@ class InfoData | ||
178 | */ | 178 | */ |
179 | public static function relateBrand($articleId, $onlyUrl = false) | 179 | public static function relateBrand($articleId, $onlyUrl = false) |
180 | { | 180 | { |
181 | - $param['article_id'] = $articleId; | 181 | + $param['article_id'] = intval($articleId); |
182 | return self::webApi(self::getUrl('getBrand'), $param, $onlyUrl); | 182 | return self::webApi(self::getUrl('getBrand'), $param, $onlyUrl); |
183 | } | 183 | } |
184 | 184 | ||
@@ -192,9 +192,9 @@ class InfoData | @@ -192,9 +192,9 @@ class InfoData | ||
192 | */ | 192 | */ |
193 | public static function relateList($articleId, $tag, $limit = 3, $onlyUrl = false) | 193 | public static function relateList($articleId, $tag, $limit = 3, $onlyUrl = false) |
194 | { | 194 | { |
195 | - $param['article_id'] = $articleId; | 195 | + $param['article_id'] = intval($articleId); |
196 | $param['tags'] = $tag; | 196 | $param['tags'] = $tag; |
197 | - $param['limit'] = $limit; | 197 | + $param['limit'] = intval($limit); |
198 | return self::webApi(self::getUrl('getOtherArticle'), $param, $onlyUrl); | 198 | return self::webApi(self::getUrl('getOtherArticle'), $param, $onlyUrl); |
199 | } | 199 | } |
200 | 200 | ||
@@ -210,8 +210,8 @@ class InfoData | @@ -210,8 +210,8 @@ class InfoData | ||
210 | public static function recommend($gender, $page = 1, $limit = 10, $onlyUrl = false) | 210 | public static function recommend($gender, $page = 1, $limit = 10, $onlyUrl = false) |
211 | { | 211 | { |
212 | $param['gender'] = $gender; | 212 | $param['gender'] = $gender; |
213 | - $param['page'] = $page; | ||
214 | - $param['limit'] = $limit; | 213 | + $param['page'] = intval($page); |
214 | + $param['limit'] = intval($limit); | ||
215 | return self::webApi(self::getUrl('getArticleByViewsNum'), $param, $onlyUrl); | 215 | return self::webApi(self::getUrl('getArticleByViewsNum'), $param, $onlyUrl); |
216 | } | 216 | } |
217 | 217 | ||
@@ -224,7 +224,7 @@ class InfoData | @@ -224,7 +224,7 @@ class InfoData | ||
224 | */ | 224 | */ |
225 | public static function addComment($id, $uid, $content) | 225 | public static function addComment($id, $uid, $content) |
226 | { | 226 | { |
227 | - $param['article_id'] = $id; | 227 | + $param['article_id'] = intval($id); |
228 | $param['uid'] = $uid; | 228 | $param['uid'] = $uid; |
229 | $param['content'] = $content; | 229 | $param['content'] = $content; |
230 | return self::webApi(self::getUrl('addComment'), $param); | 230 | return self::webApi(self::getUrl('addComment'), $param); |
@@ -238,7 +238,7 @@ class InfoData | @@ -238,7 +238,7 @@ class InfoData | ||
238 | */ | 238 | */ |
239 | public static function setPraise($id, $udid) | 239 | public static function setPraise($id, $udid) |
240 | { | 240 | { |
241 | - $param['article_id'] = $id; | 241 | + $param['article_id'] = intval($id); |
242 | $param['udid'] = $udid; | 242 | $param['udid'] = $udid; |
243 | return self::webApi(self::getUrl('setPraise'), $param); | 243 | return self::webApi(self::getUrl('setPraise'), $param); |
244 | } | 244 | } |
@@ -251,7 +251,7 @@ class InfoData | @@ -251,7 +251,7 @@ class InfoData | ||
251 | */ | 251 | */ |
252 | public static function cancelPraise($id, $udid) | 252 | public static function cancelPraise($id, $udid) |
253 | { | 253 | { |
254 | - $param['article_id'] = $id; | 254 | + $param['article_id'] = intval($id); |
255 | $param['udid'] = $udid; | 255 | $param['udid'] = $udid; |
256 | return self::webApi(self::getUrl('cancelPraise'), $param); | 256 | return self::webApi(self::getUrl('cancelPraise'), $param); |
257 | } | 257 | } |
@@ -264,7 +264,7 @@ class InfoData | @@ -264,7 +264,7 @@ class InfoData | ||
264 | */ | 264 | */ |
265 | public static function setFavorite($id, $uid) | 265 | public static function setFavorite($id, $uid) |
266 | { | 266 | { |
267 | - $param['article_id'] = $id; | 267 | + $param['article_id'] = intval($id); |
268 | $param['uid'] = $uid; | 268 | $param['uid'] = $uid; |
269 | return self::webApi(self::getUrl('setFavorite'), $param); | 269 | return self::webApi(self::getUrl('setFavorite'), $param); |
270 | } | 270 | } |
@@ -277,7 +277,7 @@ class InfoData | @@ -277,7 +277,7 @@ class InfoData | ||
277 | */ | 277 | */ |
278 | public static function cancelFavorite($id, $uid) | 278 | public static function cancelFavorite($id, $uid) |
279 | { | 279 | { |
280 | - $param['article_id'] = $id; | 280 | + $param['article_id'] = intval($id); |
281 | $param['uid'] = $uid; | 281 | $param['uid'] = $uid; |
282 | return self::webApi(self::getUrl('cancelFavorite'), $param); | 282 | return self::webApi(self::getUrl('cancelFavorite'), $param); |
283 | } | 283 | } |
@@ -513,5 +513,5 @@ class CartData | @@ -513,5 +513,5 @@ class CartData | ||
513 | $param['payment'] = $payment; | 513 | $param['payment'] = $payment; |
514 | $param['client_secret'] = Sign::getSign($param); | 514 | $param['client_secret'] = Sign::getSign($param); |
515 | return Yohobuy::get(Yohobuy::API_URL, $param); | 515 | return Yohobuy::get(Yohobuy::API_URL, $param); |
516 | - } | 516 | + } |
517 | } | 517 | } |
@@ -15,13 +15,13 @@ use Api\Sign; | @@ -15,13 +15,13 @@ use Api\Sign; | ||
15 | class SaleData | 15 | class SaleData |
16 | { | 16 | { |
17 | /** | 17 | /** |
18 | - * @param $specialsaleId 专区ID | 18 | + * @param int $specialsaleId 专区ID |
19 | * @return array | 19 | * @return array |
20 | */ | 20 | */ |
21 | public static function getSpecial($specialsaleId) | 21 | public static function getSpecial($specialsaleId) |
22 | { | 22 | { |
23 | $param = Yohobuy::param(); | 23 | $param = Yohobuy::param(); |
24 | - $param['special_id'] = $specialsaleId; | 24 | + $param['special_id'] = intval($specialsaleId); |
25 | $param['method'] = 'app.resources.getOneSpecial'; | 25 | $param['method'] = 'app.resources.getOneSpecial'; |
26 | $param['client_secret'] = Sign::getSign($param); | 26 | $param['client_secret'] = Sign::getSign($param); |
27 | 27 |
library/WebPlugin/TriggerError.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace WebPlugin; | ||
4 | + | ||
5 | +use WebPlugin\UdpLog; | ||
6 | +/** | ||
7 | + * 异常错误日志 | ||
8 | + */ | ||
9 | +class TriggerError | ||
10 | +{ | ||
11 | + public static function myErrorHandler($errno, $errstr, $errfile, $errline) | ||
12 | + { | ||
13 | +// print_r(get_defined_constants());exit; | ||
14 | + switch ($errno) { | ||
15 | + case \YAF\ERR\NOTFOUND\CONTROLLER: | ||
16 | + case \YAF\ERR\NOTFOUND\MODULE: | ||
17 | + case \YAF\ERR\NOTFOUND\ACTION: | ||
18 | + header("Not Found"); | ||
19 | + break; | ||
20 | + default: | ||
21 | + $data['errno'] = $errno; | ||
22 | + $data['errstr'] = $errstr; | ||
23 | + $data['errfile'] = $errfile; | ||
24 | + $data['errline'] = $errline; | ||
25 | + UdpLog::triggerError('triggerError',$data); | ||
26 | + break; | ||
27 | + } | ||
28 | + return true; | ||
29 | + } | ||
30 | +} |
@@ -149,6 +149,15 @@ class Bootstrap extends Bootstrap_Abstract | @@ -149,6 +149,15 @@ class Bootstrap extends Bootstrap_Abstract | ||
149 | //} | 149 | //} |
150 | } | 150 | } |
151 | 151 | ||
152 | + /** | ||
153 | + * triggerError | ||
154 | + * @param Dispatcher $dispatcher | ||
155 | + */ | ||
156 | + public function _initError(Dispatcher $dispatcher) | ||
157 | + { | ||
158 | + $dispatcher->getInstance()->setErrorHandler(array("\\WebPlugin\\TriggerError","myErrorHandler")); | ||
159 | + } | ||
160 | + | ||
152 | // /** | 161 | // /** |
153 | // * 初始化第三方包 | 162 | // * 初始化第三方包 |
154 | // * @param Dispatcher $dispatcher | 163 | // * @param Dispatcher $dispatcher |
@@ -10,6 +10,7 @@ use WebPlugin\Cache; | @@ -10,6 +10,7 @@ use WebPlugin\Cache; | ||
10 | use WebPlugin\Images; | 10 | use WebPlugin\Images; |
11 | use Configs\WebCacheConfig; | 11 | use Configs\WebCacheConfig; |
12 | use Hood\Core\Security\AuthCode; | 12 | use Hood\Core\Security\AuthCode; |
13 | +use WebPlugin\UdpLog; | ||
13 | 14 | ||
14 | /** | 15 | /** |
15 | * 购物车相关的模板数据模型 | 16 | * 购物车相关的模板数据模型 |
@@ -56,6 +57,7 @@ class CartModel | @@ -56,6 +57,7 @@ class CartModel | ||
56 | $result['isEmpty'] = true; | 57 | $result['isEmpty'] = true; |
57 | $result['guangUrl'] = Helpers::url('', null, 'list'); | 58 | $result['guangUrl'] = Helpers::url('', null, 'list'); |
58 | $result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time())); | 59 | $result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time())); |
60 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'shoppingKey:'.$shoppingKey); | ||
59 | break; | 61 | break; |
60 | } | 62 | } |
61 | 63 | ||
@@ -223,6 +225,8 @@ class CartModel | @@ -223,6 +225,8 @@ class CartModel | ||
223 | $addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); | 225 | $addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); |
224 | if ($addCart && isset($addCart['code'])) { | 226 | if ($addCart && isset($addCart['code'])) { |
225 | $result = $addCart; | 227 | $result = $addCart; |
228 | + }else{ | ||
229 | + UdpLog::info('【购物车】校验参数传递auth','productSku:'.$productSku.'buyNumber:'.$buyNumber.'goodsType:'.$goodsType,'isEdit:'.$isEdit.'promotionId:'.$promotionId.'uid:'.$uid.'shoppingKey:'.$shoppingKey); | ||
226 | } | 230 | } |
227 | 231 | ||
228 | return $result; | 232 | return $result; |
@@ -243,6 +247,7 @@ class CartModel | @@ -243,6 +247,7 @@ class CartModel | ||
243 | 247 | ||
244 | do { | 248 | do { |
245 | if (empty($skuList)) { | 249 | if (empty($skuList)) { |
250 | + UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); | ||
246 | break; | 251 | break; |
247 | } | 252 | } |
248 | 253 | ||
@@ -250,6 +255,8 @@ class CartModel | @@ -250,6 +255,8 @@ class CartModel | ||
250 | if ($select && isset($select['code'])) { | 255 | if ($select && isset($select['code'])) { |
251 | $result['code'] = $select['code']; | 256 | $result['code'] = $select['code']; |
252 | $result['message'] = $select['message']; | 257 | $result['message'] = $select['message']; |
258 | + }else{ | ||
259 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion); | ||
253 | } | 260 | } |
254 | } while (false); | 261 | } while (false); |
255 | 262 | ||
@@ -272,6 +279,7 @@ class CartModel | @@ -272,6 +279,7 @@ class CartModel | ||
272 | 279 | ||
273 | do { | 280 | do { |
274 | if (empty($skuList)) { | 281 | if (empty($skuList)) { |
282 | + UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); | ||
275 | break; | 283 | break; |
276 | } | 284 | } |
277 | 285 | ||
@@ -282,6 +290,8 @@ class CartModel | @@ -282,6 +290,8 @@ class CartModel | ||
282 | if (isset($remove['data']['goods_count'])) { | 290 | if (isset($remove['data']['goods_count'])) { |
283 | $result['total_goods_num'] = $remove['data']['goods_count']; | 291 | $result['total_goods_num'] = $remove['data']['goods_count']; |
284 | } | 292 | } |
293 | + }else{ | ||
294 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion); | ||
285 | } | 295 | } |
286 | } while (false); | 296 | } while (false); |
287 | 297 | ||
@@ -305,11 +315,11 @@ class CartModel | @@ -305,11 +315,11 @@ class CartModel | ||
305 | $result['code'] = 403; | 315 | $result['code'] = 403; |
306 | $result['message'] = '请先登录!'; | 316 | $result['message'] = '请先登录!'; |
307 | $result['data']['url'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/shopping/cart'))); | 317 | $result['data']['url'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/shopping/cart'))); |
308 | - | ||
309 | break; | 318 | break; |
310 | } | 319 | } |
311 | 320 | ||
312 | if (empty($skuList)) { | 321 | if (empty($skuList)) { |
322 | + UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); | ||
313 | break; | 323 | break; |
314 | } | 324 | } |
315 | 325 | ||
@@ -317,6 +327,8 @@ class CartModel | @@ -317,6 +327,8 @@ class CartModel | ||
317 | if ($add && isset($add['code'])) { | 327 | if ($add && isset($add['code'])) { |
318 | $result['code'] = $add['code']; | 328 | $result['code'] = $add['code']; |
319 | $result['message'] = $add['message']; | 329 | $result['message'] = $add['message']; |
330 | + }else{ | ||
331 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'hasPromotion:'.$hasPromotion); | ||
320 | } | 332 | } |
321 | } while (false); | 333 | } while (false); |
322 | 334 | ||
@@ -339,6 +351,7 @@ class CartModel | @@ -339,6 +351,7 @@ class CartModel | ||
339 | 351 | ||
340 | do { | 352 | do { |
341 | if (empty($sku)) { | 353 | if (empty($sku)) { |
354 | + UdpLog::info('【购物车】校验参数传递auth','sku:'.$sku); | ||
342 | break; | 355 | break; |
343 | } | 356 | } |
344 | 357 | ||
@@ -346,6 +359,8 @@ class CartModel | @@ -346,6 +359,8 @@ class CartModel | ||
346 | if ($modify && isset($modify['code'])) { | 359 | if ($modify && isset($modify['code'])) { |
347 | $result['code'] = $modify['code']; | 360 | $result['code'] = $modify['code']; |
348 | $result['message'] = $modify['message']; | 361 | $result['message'] = $modify['message']; |
362 | + }else{ | ||
363 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'sku:'.$sku,'increaseNum:'.$increaseNum.'decreaseNum:'.$decreaseNum.'shoppingKey:'.$shoppingKey); | ||
349 | } | 364 | } |
350 | } while (false); | 365 | } while (false); |
351 | 366 | ||
@@ -419,6 +434,7 @@ class CartModel | @@ -419,6 +434,7 @@ class CartModel | ||
419 | 434 | ||
420 | $browse = CartData::browseRecord($uid, $udid, $page, 6); | 435 | $browse = CartData::browseRecord($uid, $udid, $page, 6); |
421 | if (empty($browse['data']['product_list'])) { | 436 | if (empty($browse['data']['product_list'])) { |
437 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'udid'.$udid.'page'.$page); | ||
422 | break; | 438 | break; |
423 | } | 439 | } |
424 | 440 | ||
@@ -836,16 +852,19 @@ class CartModel | @@ -836,16 +852,19 @@ class CartModel | ||
836 | 852 | ||
837 | do { | 853 | do { |
838 | if (empty($addressId)) { | 854 | if (empty($addressId)) { |
855 | + UdpLog::info('【结算信息】配送地址参数校验','addressId为空'); | ||
839 | $result['code'] = 401; | 856 | $result['code'] = 401; |
840 | $result['message'] = '配送地址不能为空'; | 857 | $result['message'] = '配送地址不能为空'; |
841 | break; | 858 | break; |
842 | } | 859 | } |
843 | if (empty($deliveryTimeId)) { | 860 | if (empty($deliveryTimeId)) { |
861 | + UdpLog::info('【结算信息】配送时间参数校验','deliveryTime为空'); | ||
844 | $result['code'] = 402; | 862 | $result['code'] = 402; |
845 | $result['message'] = '请选择配送时间'; | 863 | $result['message'] = '请选择配送时间'; |
846 | break; | 864 | break; |
847 | } | 865 | } |
848 | if (empty($deliveryWayId)) { | 866 | if (empty($deliveryWayId)) { |
867 | + UdpLog::info('【结算信息】配送方式参数校验','deliveryWay为空'); | ||
849 | $result['code'] = 403; | 868 | $result['code'] = 403; |
850 | $result['message'] = '请选择配送方式'; | 869 | $result['message'] = '请选择配送方式'; |
851 | break; | 870 | break; |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | use Action\WebAction; | 3 | use Action\WebAction; |
4 | use WebPlugin\Helpers; | 4 | use WebPlugin\Helpers; |
5 | use Shopping\CartModel; | 5 | use Shopping\CartModel; |
6 | +use WebPlugin\UdpLog; | ||
6 | 7 | ||
7 | /** | 8 | /** |
8 | * 购物车相关的控制器 | 9 | * 购物车相关的控制器 |
@@ -451,9 +452,9 @@ class IndexController extends WebAction | @@ -451,9 +452,9 @@ class IndexController extends WebAction | ||
451 | // 调用下单接口 | 452 | // 调用下单接口 |
452 | $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, | 453 | $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, |
453 | $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); | 454 | $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); |
454 | - | ||
455 | // 判断是否下单成功 | 455 | // 判断是否下单成功 |
456 | if (empty($result['data']['order_code'])) { | 456 | if (empty($result['data']['order_code'])) { |
457 | + UdpLog::info('【结算信息】判断是否下单成功','order_code'.$result['data']['order_code']); | ||
457 | break; | 458 | break; |
458 | } | 459 | } |
459 | 460 | ||
@@ -464,13 +465,13 @@ class IndexController extends WebAction | @@ -464,13 +465,13 @@ class IndexController extends WebAction | ||
464 | 465 | ||
465 | // $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin); | 466 | // $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin); |
466 | // | 467 | // |
467 | -// // 记录下单异常的数据 | ||
468 | -// if (empty($result)) { | ||
469 | -// $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime | ||
470 | -// . ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin | ||
471 | -// . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; | ||
472 | -// error_log($message, 3, '/Data/logs/php/pc_error/order.' . date('Ym') . '.log'); | ||
473 | -// } | 468 | + // 记录下单异常的数据 |
469 | + if (empty($result)) { | ||
470 | + $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime | ||
471 | + . ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin | ||
472 | + . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; | ||
473 | + UdpLog::info('【下单】下单异常数据','message:'.$message,'返回:'.json_encode($result)); | ||
474 | + } | ||
474 | // // 返回数据 | 475 | // // 返回数据 |
475 | // else { | 476 | // else { |
476 | // // 提交成功清除Cookie | 477 | // // 提交成功清除Cookie |
@@ -7,6 +7,7 @@ use Passport\PassportModel; | @@ -7,6 +7,7 @@ use Passport\PassportModel; | ||
7 | use Configs\ChannelConfig; | 7 | use Configs\ChannelConfig; |
8 | use WebPlugin\Helpers; | 8 | use WebPlugin\Helpers; |
9 | use WebPlugin\Cache; | 9 | use WebPlugin\Cache; |
10 | +use WebPlugin\UdpLog; | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * 登录 | 13 | * 登录 |
@@ -113,6 +114,7 @@ class LoginController extends WebAction | @@ -113,6 +114,7 @@ class LoginController extends WebAction | ||
113 | $verifyCode = trim($this->post('captcha')); | 114 | $verifyCode = trim($this->post('captcha')); |
114 | $isRemember = $this->post('isRemember'); | 115 | $isRemember = $this->post('isRemember'); |
115 | if (!is_numeric($area) || empty($account) || empty($password)) { | 116 | if (!is_numeric($area) || empty($account) || empty($password)) { |
117 | + UdpLog::info('【登录】校验参数传递auth','area:'.$area.'account:'.$account.'password:'.$password); | ||
116 | break; | 118 | break; |
117 | } | 119 | } |
118 | 120 | ||
@@ -124,6 +126,7 @@ class LoginController extends WebAction | @@ -124,6 +126,7 @@ class LoginController extends WebAction | ||
124 | $verifyMobile = is_numeric($account); | 126 | $verifyMobile = is_numeric($account); |
125 | } | 127 | } |
126 | if (!$verifyEmail && !$verifyMobile) { | 128 | if (!$verifyEmail && !$verifyMobile) { |
129 | + UdpLog::info('【登录】校验账号是否有效auth','email:'.$verifyEmail.'mobile:'.$verifyMobile); | ||
127 | break; | 130 | break; |
128 | } | 131 | } |
129 | 132 | ||
@@ -165,6 +168,7 @@ class LoginController extends WebAction | @@ -165,6 +168,7 @@ class LoginController extends WebAction | ||
165 | if ($verifyCode) { | 168 | if ($verifyCode) { |
166 | $picFlag = PassportModel::verifyCode($verifyCode); | 169 | $picFlag = PassportModel::verifyCode($verifyCode); |
167 | if (!$picFlag) { | 170 | if (!$picFlag) { |
171 | + UdpLog::info('【登录】登录验证码','area:'.$area.'account:'.$account.'verifyCode:'.$verifyCode); | ||
168 | $data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha')); | 172 | $data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha')); |
169 | break; | 173 | break; |
170 | } | 174 | } |
@@ -6,6 +6,7 @@ use WebPlugin\Helpers; | @@ -6,6 +6,7 @@ use WebPlugin\Helpers; | ||
6 | use WebPlugin\Cache; | 6 | use WebPlugin\Cache; |
7 | use Passport\PassportModel; | 7 | use Passport\PassportModel; |
8 | use LibModels\Web\Passport\BindData; | 8 | use LibModels\Web\Passport\BindData; |
9 | +use WebPlugin\UdpLog; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * 注册 | 12 | * 注册 |
@@ -265,6 +266,7 @@ class RegisterController extends WebAction | @@ -265,6 +266,7 @@ class RegisterController extends WebAction | ||
265 | $mobile = trim($this->post('mobile')); | 266 | $mobile = trim($this->post('mobile')); |
266 | $area = trim($this->post('area')); | 267 | $area = trim($this->post('area')); |
267 | if (!is_numeric($mobile) || !is_numeric($area)) { | 268 | if (!is_numeric($mobile) || !is_numeric($area)) { |
269 | + UdpLog::info('【注册】参数校验', 'mobile:'.$mobile.'area:'.$area); | ||
268 | $data['message'] = '手机号码格式不正确'; | 270 | $data['message'] = '手机号码格式不正确'; |
269 | break; | 271 | break; |
270 | } | 272 | } |
@@ -272,6 +274,7 @@ class RegisterController extends WebAction | @@ -272,6 +274,7 @@ class RegisterController extends WebAction | ||
272 | /* 判断是否是有效的注册方式,防注册机刷 */ | 274 | /* 判断是否是有效的注册方式,防注册机刷 */ |
273 | $effectiveTime = $this->getSession('effective_time'); | 275 | $effectiveTime = $this->getSession('effective_time'); |
274 | if ($effectiveTime < time() || empty($effectiveTime)) { | 276 | if ($effectiveTime < time() || empty($effectiveTime)) { |
277 | + UdpLog::info('【注册】超时', 'mobile:'.$mobile.'area:'.$area); | ||
275 | $data['message'] = '注册超时'; | 278 | $data['message'] = '注册超时'; |
276 | break; | 279 | break; |
277 | } | 280 | } |
@@ -279,6 +282,7 @@ class RegisterController extends WebAction | @@ -279,6 +282,7 @@ class RegisterController extends WebAction | ||
279 | //检测验证码不正确 | 282 | //检测验证码不正确 |
280 | $verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码 | 283 | $verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码 |
281 | if (!PassportModel::verifyCode($verifyCode)) { | 284 | if (!PassportModel::verifyCode($verifyCode)) { |
285 | + UdpLog::info('【注册】验证码不正确', 'mobile:'.$mobile.'area:'.$area.'verifyCode:'.$verifyCode); | ||
282 | $data['message'] = '验证码不正确'; | 286 | $data['message'] = '验证码不正确'; |
283 | break; | 287 | break; |
284 | } | 288 | } |
@@ -287,6 +291,7 @@ class RegisterController extends WebAction | @@ -287,6 +291,7 @@ class RegisterController extends WebAction | ||
287 | $code = trim($this->post('code')); //手机验证码 | 291 | $code = trim($this->post('code')); //手机验证码 |
288 | $password = $this->post('password'); | 292 | $password = $this->post('password'); |
289 | if (!Helpers::verifyPassword($password)) { | 293 | if (!Helpers::verifyPassword($password)) { |
294 | + UdpLog::info('【注册】密码格式问题', 'mobile:'.$mobile.'area:'.$area.'password:'.$password); | ||
290 | $data['message'] = '密码不正确'; | 295 | $data['message'] = '密码不正确'; |
291 | break; | 296 | break; |
292 | } | 297 | } |
@@ -302,6 +307,7 @@ class RegisterController extends WebAction | @@ -302,6 +307,7 @@ class RegisterController extends WebAction | ||
302 | $ipTimes = intval($ipTimes); | 307 | $ipTimes = intval($ipTimes); |
303 | } | 308 | } |
304 | if ($ipTimes >= 500) { | 309 | if ($ipTimes >= 500) { |
310 | + UdpLog::info('【注册】ip限制', 'mobile:'.$mobile.'area:'.$area.'ip:'.$ip.'ipTimes:'.$ipTimes); | ||
305 | $data['message'] = '由于你IP受限无法注册'; | 311 | $data['message'] = '由于你IP受限无法注册'; |
306 | break; | 312 | break; |
307 | } | 313 | } |
@@ -309,6 +315,7 @@ class RegisterController extends WebAction | @@ -309,6 +315,7 @@ class RegisterController extends WebAction | ||
309 | /* 验证注册的标识码是否有效 */ | 315 | /* 验证注册的标识码是否有效 */ |
310 | $data = RegData::validMobileCode($area, $mobile, $code); | 316 | $data = RegData::validMobileCode($area, $mobile, $code); |
311 | if (!isset($data['code']) || $data['code'] != 200) { | 317 | if (!isset($data['code']) || $data['code'] != 200) { |
318 | + UdpLog::info('【注册】短信验证码校验', 'mobile:'.$mobile.'area:'.$area.'code:'.$code); | ||
312 | $data['message'] = '验证码错误'; | 319 | $data['message'] = '验证码错误'; |
313 | break; | 320 | break; |
314 | } | 321 | } |
-
Please register or login to post a comment