+ add api library class.
This commit is contained in:
Executable
+1447
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,10 @@ class api extends control
|
||||
$module = $this->loadModel($moduleName);
|
||||
$result = call_user_func_array(array(&$module, $methodName), $params);
|
||||
if(dao::isError()) die(json_encode(dao::getError()));
|
||||
die(json_encode($result));
|
||||
$output['status'] = $result ? 'success' : 'fail';
|
||||
$output['data'] = json_encode($result);
|
||||
$output['md5'] = md5($output['data']);
|
||||
$this->output = json_encode($output);
|
||||
die($this->output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,15 +324,18 @@ class user extends control
|
||||
$from == 'zentao'
|
||||
)
|
||||
{
|
||||
if($this->app->getViewType() == 'json') die(json_encode(array('status' => 'success')));
|
||||
die(js::locate($_POST['referer'], 'parent'));
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->app->getViewType() == 'json') die(json_encode(array('status' => 'success')));
|
||||
die(js::locate($this->createLink($this->config->default->module), 'parent'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->app->getViewType() == 'json') die(json_encode(array('status' => 'failed')));
|
||||
die(js::error($this->lang->user->loginFailed));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user