Merge branches 'dev_aliyun' and 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into topic_bank
commit
b918fc16d7
@ -1,7 +1,10 @@
|
|||||||
class Wechats::JsSdkSignaturesController < ApplicationController
|
class Wechats::JsSdkSignaturesController < ApplicationController
|
||||||
def create
|
def create
|
||||||
signature = Util::Wechat.js_sdk_signature(params[:url], params[:noncestr], params[:timestamp])
|
timestamp = (Time.now.to_f * 1000).to_i
|
||||||
render_ok(signature: signature)
|
noncestr = ('A'..'z').to_a.sample(8).join
|
||||||
|
signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp)
|
||||||
|
|
||||||
|
render_ok(appid: Util::Wechat.appid, timestamp: timestamp, noncestr: noncestr, signature: signature)
|
||||||
rescue Util::Wechat::Error => ex
|
rescue Util::Wechat::Error => ex
|
||||||
render_error(ex.message)
|
render_error(ex.message)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in new issue