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
8def2ba4
Commit
8def2ba4
authored
Jul 14, 2021
by
万从磊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_push_v2' into 'master'
推送判断client_id See merge request
!10
parents
d50f3f68
63880dad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
app/controllers/pushs_controller.rb
+8
-6
No files found.
app/controllers/pushs_controller.rb
View file @
8def2ba4
...
...
@@ -13,9 +13,9 @@ class PushsController < ApplicationController
render
json:
{
code:
-
1
,
message:
'应用不存在或者app_id/app_secret不匹配'
}
end
end
def
push_v2
param!
:app_name
,
String
,
required:
true
,
in:
%w(crm)
param!
:app_name
,
String
,
required:
true
,
in:
%w(crm)
# param! :device_ids_opts, String, required: true
param!
:message
,
String
,
required:
true
# param! :igetui_opts, String
...
...
@@ -27,8 +27,10 @@ class PushsController < ApplicationController
user_ids
=
params
[
:user_ids
]
rescue
[]
user_device_exist
=
UserDevice
.
where
(
user_id:
user_ids
).
exists?
user_devices
=
UserDevice
.
where
(
user_id:
user_ids
)
client_id
=
message
.
dig
(
'transmission_content'
,
'extras'
,
'extra'
,
'client_id'
)
user_devices
=
user_devices
.
where
.
not
(
client_id:
client_id
)
if
client_id
user_device_exist
=
user_devices
.
exists?
unless
user_device_exist
return
render
json:
{
code:
-
1
,
message:
'user_device找不到,user_ids错误'
}
...
...
@@ -47,7 +49,7 @@ class PushsController < ApplicationController
# else
# render json: { code: 401, message: 'token 错误/过期'}
# end
end
def
received
...
...
@@ -81,7 +83,7 @@ class PushsController < ApplicationController
# 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'
)})
# NotificationStatistic.create_by_params(igetui_opts, message, device_ids_opts, params[:app_type])
...
...
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