dever 7 years ago
parent
commit
4e533670ac
1 changed files with 10 additions and 0 deletions
  1. 10 0
      tm/lib/Controller/EventsController.class.php

+ 10 - 0
tm/lib/Controller/EventsController.class.php

@@ -138,6 +138,10 @@ class EventsController extends Controller {
 		if ($authorize) {
 				if($ckLogin==true){
 					$info['login'] = 2;//需要登录
+					$weixin = $this->checkIsFromWeixin();
+					if (!$weixin) {
+						self::redirect($loginUrl);
+					}
 					//self::redirect($loginUrl);
 				}
 		}
@@ -489,9 +493,15 @@ class EventsController extends Controller {
 			if (!$tokenid) {
 				$tokenid = Request::g('tokenId');
 			}
+			if ($tokenid) {
+				$_COODIE['tokenid'] = $tokenid;
+			}
 			if ($tokenid) {
 				# app中已登陆
 				$passport_url .= '&tokenid=' . $tokenid;
+			} elseif (isset($_COODIE['tokenid'])) {
+				# app中已登陆
+				$passport_url .= '&tokenid=' . $_COODIE['tokenid'];
 			} else {
 				# app中未登陆
 				$this->setOutput('applogin', 1);