mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
init project
This commit is contained in:
11
app/controllers/wechats/js_sdk_signatures_controller.rb
Normal file
11
app/controllers/wechats/js_sdk_signatures_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class Wechats::JsSdkSignaturesController < ApplicationController
|
||||
def create
|
||||
timestamp = Time.now.to_i
|
||||
noncestr = ('A'..'z').to_a.sample(8).join
|
||||
signature = Wechat::OfficialAccount.js_sdk_signature(params[:url], noncestr, timestamp)
|
||||
|
||||
render_ok(appid: Wechat::OfficialAccount.appid, timestamp: timestamp, noncestr: noncestr, signature: signature)
|
||||
rescue Wechat::Error => ex
|
||||
render_error(ex.message)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user