Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
O
Open-Platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杜宇森
Open-Platform
Commits
2d06f672
Commit
2d06f672
authored
Sep 16, 2021
by
UtopiaXC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐟
摸鱼~
parent
424491b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
README.md
README.md
+1
-1
api_list.blade.php
resources/views/api_list.blade.php
+0
-1
api.php
routes/api.php
+26
-4
No files found.
README.md
View file @
2d06f672
...
...
@@ -2,5 +2,5 @@
这是一款基于Laravel的可以即时部署在任何服务器上的开源开放平台,正在开发。
具体进展请参考dev分支
## 原型:
index
## 原型:
[index](https://open.utopiaxc.cn/)
![
index.png
](
images/index.png
)
resources/views/api_list.blade.php
View file @
2d06f672
...
...
@@ -52,7 +52,6 @@
<h4>基本信息</h4>
<table>
</table>
</div>
</div>
...
...
routes/api.php
View file @
2d06f672
...
...
@@ -2,6 +2,7 @@
use
App\Http\Controllers\CaptchaController
;
use
App\Http\Controllers\UserController
;
use
App\Http\Utils\R
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Route
;
...
...
@@ -16,7 +17,28 @@ use Illuminate\Support\Facades\Route;
|
*/
Route
::
get
(
ApiUrl
::
CAPTCHA
,[
CaptchaController
::
class
,
"getCaptcha"
]);
Route
::
post
(
ApiUrl
::
USER
.
ApiUrl
::
REGISTER
,
[
UserController
::
class
,
"register"
]);
Route
::
post
(
ApiUrl
::
USER
.
ApiUrl
::
LOGIN
,[
UserController
::
class
,
"login"
]);
Route
::
put
(
ApiUrl
::
USER
.
ApiUrl
::
LOGOUT
,[
UserController
::
class
,
"logout"
]);
Route
::
get
(
ApiUrl
::
CAPTCHA
,
[
CaptchaController
::
class
,
"getCaptcha"
]);
Route
::
post
(
ApiUrl
::
USER
.
ApiUrl
::
REGISTER
,
[
UserController
::
class
,
"register"
]);
Route
::
post
(
ApiUrl
::
USER
.
ApiUrl
::
LOGIN
,
[
UserController
::
class
,
"login"
]);
Route
::
put
(
ApiUrl
::
USER
.
ApiUrl
::
LOGOUT
,
[
UserController
::
class
,
"logout"
]);
//暂时使用 用于Telegram消息推送
Route
::
group
([
'prefix'
=>
'/'
,
'middleware'
=>
[
Middleware
::
AUTH_MIDDLEWARE
]],
function
()
{
Route
::
post
(
"/send_telegram"
,
function
(
Request
$request
)
{
if
(
@!
$request
->
get
(
"token"
)
||
@!
$request
->
get
(
"message"
)
||
@!
$request
->
get
(
"bot_id"
)
||
@!
$request
->
get
(
"chat_id"
))
{
return
R
::
error
(
HTTP_CODE
::
NOT_ACCEPT_PARAMS_CONTENT_WRONG
);
}
$disable_notification
=
false
;
if
(
@
$request
->
get
(
'$disable_notification'
)
==
true
)
{
$disable_notification
=
true
;
}
$response
=
Http
::
post
(
'https://api.utopiaxc.com/sendTelegramMessage.php'
,
[
'token'
=>
$request
->
get
(
"token"
),
'message'
=>
$request
->
get
(
"message"
),
'bot_id'
=>
$request
->
get
(
"bot_id"
),
'chat_id'
=>
$request
->
get
(
"chat_id"
),
'disable_notification'
=>
$disable_notification
]);
return
R
::
ok
();
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment