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
aea41661
Commit
aea41661
authored
Apr 21, 2020
by
梁宇哲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/tmp_remove_token_auth' into 'master'
临时去掉验证 See merge request
!4
parents
b8b1c0de
18731e84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
app/controllers/pushs_controller.rb
+16
-16
No files found.
app/controllers/pushs_controller.rb
View file @
aea41661
...
...
@@ -34,19 +34,19 @@ class PushsController < ApplicationController
return
render
json:
{
code:
-
1
,
message:
'user_device找不到,user_ids错误'
}
end
token_array
=
token_and_options
(
request
)
if
token_array
.
blank?
return
render
json:
{
code:
401
,
message:
'token错误'
}
end
#
token_array = token_and_options(request)
#
if token_array.blank?
#
return render json: { code: 401, message: 'token错误'}
#
end
params
[
:sync_push
]
||=
false
if
validate_token
(
params
[
:app_name
],
token_array
.
first
)
#
if validate_token(params[:app_name], token_array.first)
push_sync
(
params
[
:sync_push
],
{
user_ids:
user_ids
,
message:
message
,
igetui_opts:
igetui_opts
.
merge
(
pusher_type:
'push_message_to_list'
)})
render
json:
{
code:
0
,
message:
'success'
,
describe:
'异步任务正在处理'
}
else
render
json:
{
code:
401
,
message:
'token 错误/过期'
}
end
#
else
#
render json: { code: 401, message: 'token 错误/过期'}
#
end
end
...
...
@@ -74,12 +74,12 @@ class PushsController < ApplicationController
message
=
JSON
.
parse
(
params
[
:message
])
rescue
{}
device_ids_opts
=
JSON
.
parse
(
params
[
:device_ids_opts
])
rescue
{}
token_array
=
token_and_options
(
request
)
if
token_array
.
blank?
return
render
json:
{
code:
401
,
message:
'token错误'
}
end
#
token_array = token_and_options(request)
#
if token_array.blank?
#
return render json: { code: 401, message: 'token错误'}
#
end
if
validate_token
(
params
[
:app_name
],
token_array
.
first
)
#
if validate_token(params[:app_name], token_array.first)
params
[
:sync_push
]
||=
false
push_sync
(
params
[
:sync_push
],
{
device_ids_opts:
device_ids_opts
,
message:
message
,
app_type:
params
[
:app_type
],
igetui_opts:
igetui_opts
.
merge
(
pusher_type:
'push_message_to_list'
)})
...
...
@@ -87,9 +87,9 @@ class PushsController < ApplicationController
render
json:
{
code:
0
,
message:
'success'
,
data:
{
remind:
"请使用新的api,此api近期将不再维护,请尽快迁移到新的api,新api地址 http://apidoc.weiwenjia.com/docs/internal-dev-api/internal-dev-api-1boq6ctdm8m57"
}}
else
render
json:
{
code:
401
,
message:
'token 错误/过期'
}
end
#
else
#
render json: { code: 401, message: 'token 错误/过期'}
#
end
end
private
...
...
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