From 981a191b0567926594e3ab1c1fd6cb8e0a10d9d8 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 13 Mar 2017 11:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=8F=91=E9=80=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/trustie/sms/sms.rb | 6 +++--- spec/utils/sms_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/trustie/sms/sms.rb b/lib/trustie/sms/sms.rb index bd530ec2d..5fdf0abd7 100644 --- a/lib/trustie/sms/sms.rb +++ b/lib/trustie/sms/sms.rb @@ -21,7 +21,7 @@ module Trustie def self.sendYunpian(mobile, code) #修改为您的apikey.可在官网(http://www.yunpian.com)登录后用户中心首页看到 - apikey = '21fe1680cb994616fd86f678a7022402' + apikey = '2affbf2ff83f9810512622ec83bccd4f' #指定模板发送接口HTTP地址 send_tpl_sms_uri = URI.parse('https://sms.yunpian.com/v2/sms/tpl_single_send.json') @@ -32,8 +32,8 @@ module Trustie #设置模板ID,如使用1号模板:【#company#】您的验证码是#code# #设置对应的模板变量值 - params['tpl_id'] = 1733172 - params['tpl_value'] = URI::escape('#code#')+'='+URI::escape(code)+'&'+URI::escape('#app#')+'='+URI::escape('确实') + params['tpl_id'] = 1733594 + params['tpl_value'] = URI::escape('#code#')+'='+URI::escape(code) response = Net::HTTP.post_form(send_tpl_sms_uri,params) ActiveSupport::JSON.decode(response.body) end diff --git a/spec/utils/sms_spec.rb b/spec/utils/sms_spec.rb index 3a30bec29..03e0c36e3 100644 --- a/spec/utils/sms_spec.rb +++ b/spec/utils/sms_spec.rb @@ -6,7 +6,7 @@ require 'rails_helper' describe "短信发送" do it "可以成功发送,当参数正确时" do - status = Trustie::Sms.send(mobile: "15607313800", code: '1234') + status = Trustie::Sms.send(mobile: "15388083362", code: '1234') expect(status).to be true end