Application/Wap/Controller/CommonController.class.php

(完整代码) 1KB

<?php
namespace Wap\Controller;
use Think\Controller;

class CommonController extends Controller {
	public function _initialize (){
	    
		//session('userid',1);
	
		if(session('userid') == ''){
			$s = $this->geturl();
			if(check_is_weixin() && check_is_wxapp()){
			   $this->redirect('Wxlogin/index?urls='.$s);
			} else {
			   $this->redirect('Login/index');
			}
		} else {
			$userid = session('userid');
			$usernum = M('user')->where("id=%d",$userid)->count();
			if($usernum == 0){
				$s = $this->geturl();
				if(check_is_weixin() && check_is_wxapp() ){
				   $this->redirect('Wxlogin/index?urls='.$s);
				} else {
				   $this->redirect('Login/index?urls');
				}
			}
		}
	}	
	
	private function geturl(){
		  parse_str(htmlspecialchars_decode($_SERVER['QUERY_STRING']), $canshu);
		  $urlstr[] = 'm-'.$canshu['m'];
		  $urlstr[] = 'c-'.$canshu['c'];
		  $urlstr[] = 'a-'.$canshu['a'];
		  $urlstr[] = 'ntype-'.$canshu['ntype'];
		  $urls = implode('|',$urlstr);
		  return $urls;
	}
}
?>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。