mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 优化API路由生成接口
This commit is contained in:
parent
7531ef30e0
commit
6b82206f63
@ -188,7 +188,7 @@ class InterfaceList extends Base {
|
||||
array_push($tplStr, 'Route::rule(\'' . addslashes($value->hash) . '\',\'api/' . addslashes($value->api_class) . '\', \'' . $methodArr[$value->method] . '\')->middleware([\'ApiAuth\', \'ApiPermission\', \'RequestFilter\', \'ApiLog\']);');
|
||||
}
|
||||
}
|
||||
$tplOriginStr = str_replace(['{$API_RULE}'], [implode($tplStr, "\n ")], $tplOriginStr);
|
||||
$tplOriginStr = str_replace(['{$API_RULE}'], [implode($tplStr, PHP_EOL . ' ')], $tplOriginStr);
|
||||
|
||||
file_put_contents($apiRoutePath, $tplOriginStr);
|
||||
|
||||
|
@ -31,5 +31,7 @@ class UpdateAdminMenuData extends Migrator {
|
||||
$this->execute('UPDATE `admin_menu` SET `level` = 1 WHERE `fid` = 0;');
|
||||
$this->execute('UPDATE `admin_menu` SET `level` = 3 WHERE `url` != "";');
|
||||
$this->execute('UPDATE `admin_menu` SET `level` = 2 WHERE `level` = 0;');
|
||||
$this->execute('UPDATE `admin_menu` SET `auth` = 1 WHERE `url` != "admin/Login/index";');
|
||||
$this->execute('UPDATE `admin_menu` SET `permission` = 0 WHERE `url` = "admin/Login/index" OR `url` = "admin/Login/logout";');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user