mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 新增刷新AppSecret的功能
This commit is contained in:
parent
d0f5772cb9
commit
869b65d605
@ -80,6 +80,24 @@ class App extends Base {
|
|||||||
return $this->buildSuccess($res);
|
return $this->buildSuccess($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新APPSecret
|
||||||
|
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function refreshAppSecret() {
|
||||||
|
$id = $this->request->get('id', 0);
|
||||||
|
$data['app_secret'] = Strs::randString(32);
|
||||||
|
if ($id) {
|
||||||
|
$res = AdminApp::update($data, ['id' => $id]);
|
||||||
|
if ($res === false) {
|
||||||
|
return $this->buildFailed(ReturnCode::DB_SAVE_ERROR, '操作失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->buildSuccess($data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增应用
|
* 新增应用
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -51,7 +51,7 @@ Route::group('admin',function(){
|
|||||||
'del' =>[
|
'del' =>[
|
||||||
'admin/Menu/del',
|
'admin/Menu/del',
|
||||||
['method' => 'get']
|
['method' => 'get']
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
Route::group('User',[
|
Route::group('User',[
|
||||||
'index'=> [
|
'index'=> [
|
||||||
@ -122,6 +122,10 @@ Route::group('admin',function(){
|
|||||||
'admin/App/index',
|
'admin/App/index',
|
||||||
['method' => 'get']
|
['method' => 'get']
|
||||||
],
|
],
|
||||||
|
'refreshAppSecret'=> [
|
||||||
|
'admin/App/refreshAppSecret',
|
||||||
|
['method' => 'get']
|
||||||
|
],
|
||||||
'changeStatus' =>[
|
'changeStatus' =>[
|
||||||
'admin/App/changeStatus',
|
'admin/App/changeStatus',
|
||||||
['method' => 'get']
|
['method' => 'get']
|
||||||
@ -267,4 +271,4 @@ Route::group('admin',function(){
|
|||||||
]);
|
]);
|
||||||
Route::miss('admin/Miss/index');
|
Route::miss('admin/Miss/index');
|
||||||
},['after_behavior' => $afterBehavior]
|
},['after_behavior' => $afterBehavior]
|
||||||
);
|
);
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
# https://github.com/sequelpro/sequelpro
|
# https://github.com/sequelpro/sequelpro
|
||||||
#
|
#
|
||||||
# Host: 127.0.0.1 (MySQL 5.5.5-10.2.12-MariaDB)
|
# Host: 127.0.0.1 (MySQL 5.5.5-10.2.12-MariaDB)
|
||||||
# Database: demo
|
# Database: apiadmin_new
|
||||||
# Generation Time: 2018-04-11 01:21:30 +0000
|
# Generation Time: 2018-06-10 07:00:01 +0000
|
||||||
# ************************************************************
|
# ************************************************************
|
||||||
|
|
||||||
|
|
||||||
@ -144,9 +144,15 @@ CREATE TABLE `admin_group` (
|
|||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='接口组管理';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='接口组管理';
|
||||||
|
|
||||||
|
LOCK TABLES `admin_group` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `admin_group` DISABLE KEYS */;
|
||||||
|
|
||||||
INSERT INTO `admin_group` (`id`, `name`, `description`, `status`, `hash`, `addTime`, `updateTime`, `image`, `hot`)
|
INSERT INTO `admin_group` (`id`, `name`, `description`, `status`, `hash`, `addTime`, `updateTime`, `image`, `hot`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, '默认分组', '默认分组', 1, 'default', 0, 0, NULL, 0);
|
(1,'默认分组','默认分组',1,'default',0,0,'',0);
|
||||||
|
|
||||||
|
/*!40000 ALTER TABLE `admin_group` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
|
||||||
# Dump of table admin_list
|
# Dump of table admin_list
|
||||||
@ -261,7 +267,8 @@ VALUES
|
|||||||
(64,'删除单条日志记录',62,'admin/Log/del',0,0,0,'',0),
|
(64,'删除单条日志记录',62,'admin/Log/del',0,0,0,'',0),
|
||||||
(65,'刷新路由',31,'admin/InterfaceList/refresh',0,0,0,'',0),
|
(65,'刷新路由',31,'admin/InterfaceList/refresh',0,0,0,'',0),
|
||||||
(67,'文件上传',0,'admin/Index/upload',0,0,0,'',0),
|
(67,'文件上传',0,'admin/Index/upload',0,0,0,'',0),
|
||||||
(68,'更新个人信息',9,'admin/User/own',0,0,0,'',0);
|
(68,'更新个人信息',9,'admin/User/own',0,0,0,'',0),
|
||||||
|
(69,'刷新AppSecret',24,'admin/App/refreshAppSecret',0,0,0,'',0);
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `admin_menu` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `admin_menu` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
@ -290,7 +297,7 @@ LOCK TABLES `admin_user` WRITE;
|
|||||||
|
|
||||||
INSERT INTO `admin_user` (`id`, `username`, `nickname`, `password`, `regTime`, `regIp`, `updateTime`, `status`, `openId`)
|
INSERT INTO `admin_user` (`id`, `username`, `nickname`, `password`, `regTime`, `regIp`, `updateTime`, `status`, `openId`)
|
||||||
VALUES
|
VALUES
|
||||||
(1,'root','root','912601e4ad1b308c9ae41877cf6ca754',1519453594,3663623043,1520173599,1,NULL);
|
(1,'root','root','912601e4ad1b308c9ae41877cf6ca754',1519453594,3663623043,1524152828,1,NULL);
|
||||||
|
|
||||||
/*!40000 ALTER TABLE `admin_user` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `admin_user` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user