完全vue渲染列表的功能
去掉不必要的js函数定义 修改返回json的方式
This commit is contained in:
@@ -130,7 +130,7 @@ class DepartmentController extends DefaultController
|
||||
'name' => '全体人员',
|
||||
'text' => '全体人员',
|
||||
];
|
||||
return response()->json(['data' => $data]);
|
||||
return ['data' => $data];
|
||||
}
|
||||
return $this->render([
|
||||
'search' => $search
|
||||
|
||||
@@ -150,7 +150,7 @@ class MessageController extends Controller
|
||||
->where('read_id', Auth::id())
|
||||
->where('status', 0)
|
||||
->count();
|
||||
return response()->json($count);
|
||||
return $count;
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
|
||||
@@ -97,7 +97,7 @@ class PositionController extends DefaultController
|
||||
}
|
||||
}
|
||||
$rows = $model->get(['*', 'name as text']);
|
||||
return response()->json(['data' => $rows]);
|
||||
return ['data' => $rows];
|
||||
}
|
||||
return $this->render([
|
||||
'search' => $search,
|
||||
|
||||
@@ -205,7 +205,7 @@ class RoleController extends DefaultController
|
||||
$row['sid'] = 'r'.$row['id'];
|
||||
$data[] = $row;
|
||||
}
|
||||
return response()->json(['data' => $data]);
|
||||
return ['data' => $data];
|
||||
}
|
||||
return $this->render([
|
||||
'search' => $search,
|
||||
|
||||
@@ -37,11 +37,11 @@ class TokenController extends Controller
|
||||
}
|
||||
|
||||
if (empty($gets['username'])) {
|
||||
return response()->json(['message'=>'账户不能为空。','success'=>false]);
|
||||
return ['message'=>'账户不能为空。','success'=>false];
|
||||
}
|
||||
|
||||
if (empty($gets['password'])) {
|
||||
return response()->json(['message'=>'密码不能为空。','success'=>false]);
|
||||
return ['message'=>'密码不能为空。','success'=>false];
|
||||
}
|
||||
|
||||
$credentials = [
|
||||
@@ -55,7 +55,7 @@ class TokenController extends Controller
|
||||
|
||||
if ($user['auth_device']) {
|
||||
if (empty($gets['deviceId'])) {
|
||||
return response()->json(['message'=>'设备ID不能为空。','success'=>false]);
|
||||
return ['message'=>'设备ID不能为空。','success'=>false];
|
||||
}
|
||||
|
||||
// 设备ID为空时自动绑定
|
||||
@@ -65,7 +65,7 @@ class TokenController extends Controller
|
||||
// 存在设备ID检查是否匹配
|
||||
$auth_device_id = explode(PHP_EOL, $user['auth_device_id']);
|
||||
if (in_array($gets['deviceId'], $auth_device_id) == false) {
|
||||
return response()->json(['message'=>'设备ID错误,请联系相关人员。','success'=>false]);
|
||||
return ['message'=>'设备ID错误,请联系相关人员。','success'=>false];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,18 +74,18 @@ class TokenController extends Controller
|
||||
$user->save();
|
||||
|
||||
$assets = UserAssetService::getRoleAssets($user->role_id);
|
||||
return response()->json([
|
||||
return [
|
||||
'user' => $user,
|
||||
'token' => $this->createToken($user->id),
|
||||
'access' => $assets,
|
||||
'success' => 1,
|
||||
]);
|
||||
];
|
||||
}
|
||||
return response()->json(['message'=>'账户或密码错误。', 'success'=>false]);
|
||||
return ['message'=>'账户或密码错误。', 'success'=>false];
|
||||
}
|
||||
|
||||
public function logoutAction()
|
||||
{
|
||||
return response('注销完成。');
|
||||
return '注销完成。';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,9 +163,7 @@ class UserController extends DefaultController
|
||||
[user].email,
|
||||
[user].phone
|
||||
");
|
||||
$rows = $model->paginate($query['limit']);
|
||||
|
||||
return response()->json($rows);
|
||||
return $model->paginate($query['limit']);
|
||||
}
|
||||
return $this->render(array(
|
||||
'search' => $search,
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
var action = config.action;
|
||||
var search = config.search;
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
var grid = new agGridOptions();
|
||||
|
||||
var gridDiv = document.querySelector("#{{$header['table']}}-grid");
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
var action = config.action;
|
||||
var search = config.search;
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
var grid = new agGridOptions();
|
||||
|
||||
var gridDiv = document.querySelector("#{{$header['table']}}-grid");
|
||||
|
||||
@@ -42,11 +42,6 @@
|
||||
statusAction('unread');
|
||||
};
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function(e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
var grid = new agGridOptions();
|
||||
grid.remoteDataUrl = '{{url()}}';
|
||||
grid.remoteParams = search.advanced.query;
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
var action = config.action;
|
||||
var search = config.search;
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
var grid = new agGridOptions();
|
||||
|
||||
var gridDiv = document.querySelector("#{{$header['table']}}-grid");
|
||||
|
||||
@@ -16,11 +16,6 @@
|
||||
top.addTab('user/role/config?role_id=' + data.master_id, 'role_config', '权限配置');
|
||||
}
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
var grid = new agGridOptions();
|
||||
var gridDiv = document.querySelector("#{{$header['table']}}-grid");
|
||||
gridDiv.style.height = getPanelHeight(48);
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
|
||||
action.dialogType = 'layer';
|
||||
|
||||
// 自定义搜索方法
|
||||
search.searchInit = function (e) {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
action.user_warehouse = function(data) {
|
||||
var me = this;
|
||||
var grid = config.grid;
|
||||
|
||||
Reference in New Issue
Block a user