-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
40 lines (34 loc) · 1.02 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require 'init.php';
//世纪互联
//onedrive::$api_url = "https://microsoftgraph.chinacloudapi.cn/v1.0";
//onedrive::$oauth_url = "https://login.partner.microsoftonline.cn/common/oauth2/v2.0";
/**
* 程序安装
*/
if( empty( config('refresh_token') ) ){
route::any('/','AdminController@install');
}
/**
* 系统后台
*/
route::group(function(){
return ($_COOKIE['admin'] == md5(config('password').config('refresh_token')) );
},function(){
route::get('/logout','AdminController@logout');
route::any('/admin/','AdminController@settings');
route::any('/admin/cache','AdminController@cache');
route::any('/admin/show','AdminController@show');
route::any('/admin/setpass','AdminController@setpass');
});
//登陆
route::any('/login','AdminController@login');
//跳转到登陆
route::any('/admin/',function(){
return view::direct(get_absolute_path(dirname($_SERVER['SCRIPT_NAME'])).'?/login');
});
/**
* 列目录
*/
define('VIEW_PATH', ROOT.'view/material/');
route::any('{path:#all}','IndexController@index');