Commit 137cb709 authored by zfc's avatar zfc Committed by hujun

刻苦

parent 06730cf4
...@@ -81,23 +81,23 @@ class Basic extends Controller ...@@ -81,23 +81,23 @@ class Basic extends Controller
if ($session != NULL) { if ($session != NULL) {
//判断当前控制器用户是否拥有进入权限 //判断当前控制器用户是否拥有进入权限
foreach ($session as $v){ foreach ($session as $v){
//不区分大小写
if (strcasecmp(trim($v['name']), $requestPath) == 0){
$rule = $v;
}
}
} }
if ($rule == 0){ public function userAuth(){
if ($this->request->isAjax()){ $request= \think\Request::instance();
return $this->response('300','没有权限'); $r= $request->controller();
} $route= $request->module();
} else { $name= $request->action();
Session::set("userRule",$rule); $url=$route."/".$name;
}
} }
/** /**
* 验证登录时效 * 验证登录时效
*/ */
......
...@@ -32,6 +32,8 @@ function getUrlParam(name) { ...@@ -32,6 +32,8 @@ function getUrlParam(name) {
if(r != null) return unescape(r[2]); if(r != null) return unescape(r[2]);
return null; return null;
} }
//字符串格式化 //字符串格式化
String.prototype.stringFormat = function(){ String.prototype.stringFormat = function(){
var formatted = this; var formatted = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment