Commit aea41661 by 梁宇哲

Merge branch 'hotfix/tmp_remove_token_auth' into 'master'

临时去掉验证

See merge request !4
parents b8b1c0de 18731e84
...@@ -34,19 +34,19 @@ class PushsController < ApplicationController ...@@ -34,19 +34,19 @@ class PushsController < ApplicationController
return render json: { code: -1, message: 'user_device找不到,user_ids错误'} return render json: { code: -1, message: 'user_device找不到,user_ids错误'}
end end
token_array = token_and_options(request) # token_array = token_and_options(request)
if token_array.blank? # if token_array.blank?
return render json: { code: 401, message: 'token错误'} # return render json: { code: 401, message: 'token错误'}
end # end
params[:sync_push] ||= false 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')}) 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: '异步任务正在处理'} render json: { code: 0, message: 'success', describe: '异步任务正在处理'}
else # else
render json: { code: 401, message: 'token 错误/过期'} # render json: { code: 401, message: 'token 错误/过期'}
end # end
end end
...@@ -74,12 +74,12 @@ class PushsController < ApplicationController ...@@ -74,12 +74,12 @@ class PushsController < ApplicationController
message = JSON.parse(params[:message]) rescue {} message = JSON.parse(params[:message]) rescue {}
device_ids_opts = JSON.parse(params[:device_ids_opts]) rescue {} device_ids_opts = JSON.parse(params[:device_ids_opts]) rescue {}
token_array = token_and_options(request) # token_array = token_and_options(request)
if token_array.blank? # if token_array.blank?
return render json: { code: 401, message: 'token错误'} # return render json: { code: 401, message: 'token错误'}
end # end
if validate_token(params[:app_name], token_array.first) # if validate_token(params[:app_name], token_array.first)
params[:sync_push] ||= false 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')}) 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 ...@@ -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"}} 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 # else
render json: { code: 401, message: 'token 错误/过期'} # render json: { code: 401, message: 'token 错误/过期'}
end # end
end end
private private
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment