Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app_push
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
app_push
Commits
054043ed
Commit
054043ed
authored
Dec 25, 2019
by
liangyuzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义api controller
parent
6e91099e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
app/controllers/application_controller.rb
+7
-1
app/controllers/pushs_controller.rb
+1
-1
No files found.
app/controllers/application_controller.rb
View file @
054043ed
class
ApplicationController
<
ActionController
::
Base
class
ApplicationController
<
ActionController
::
Metal
ActionController
::
API
.
without_modules
(
:ForceSSL
,
:UrlFor
).
each
do
|
left
|
include
left
end
include
RailsParam
::
Param
rescue_from
StandardError
,
with: :rescue_all
include
TokenValidate
def
rescue_all
(
e
)
ErrorLog
.
error
(
e
)
render
json:
{
code:
500
,
message:
'抱歉~ 系统出错了,攻城狮们已经在修理了!'
,
error:
e
.
class
.
name
.
underscore
,
original_message:
e
.
message
}
...
...
app/controllers/pushs_controller.rb
View file @
054043ed
class
PushsController
<
ApplicationController
include
ActionController
::
HttpAuthentication
::
Token
skip_before_action
:verify_authenticity_token
#
skip_before_action :verify_authenticity_token
def
token
param!
:app_name
,
String
,
required:
true
...
...
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