[Java] 发送手机验证码 →→→→→进入此内容的聊天室

来自 , 2019-06-19, 写在 Java, 查看 109 次.
URL http://www.code666.cn/view/e0040614
  1. /**
  2.  *
  3.  * @包名 :com.feel.common.util
  4.  * @文件名 :SendMobileRand.java
  5.  * TODO 类作用:发送手机验证码
  6.  * @系统名称 : 丰盛达商城
  7.  * @Author: 刘泽中
  8.  * @Date: 2015-9-8 下午2:41:08
  9.  * @版本号   :v0.0.01
  10.  */
  11. public class SendMobileRand {
  12.         /**
  13.          *
  14.          * TODO 方法作用: 发送手机验证码
  15.          * @param mobile 手机号
  16.          * @param model  模板代码
  17.          * @param mobile_rand 验证码
  18.          * @param time 超时时间
  19.          * @return    
  20.          * @Author: 刘泽中
  21.          * @Date: 2015-8-26 上午8:51:21
  22.          */
  23.         public synchronized Map<String, Object>  sendTemplateSMS(String mobile,String model,String mobile_rand,String time) {
  24.                 HashMap<String, Object> result = new HashMap<String, Object>();
  25.                 CCPRestSDK restAPI = new CCPRestSDK();
  26.                 model = "34279";
  27.                 restAPI.init("app.cloopen.com", "8883");// 初始化服务器地址和端口,格式如下,服务器地址不需要写https://
  28.                 restAPI.setAccount("8a48b5514f4fc588014f5d385f0511a8", "7ed66cb3a38d426a9a0cee83809d7ddd");// 初始化主帐号和主帐号TOKEN
  29.                 restAPI.setAppId("8a48b5514f4fc588014f5d3a9edd11b4");// 应用ID
  30.                 try{
  31.                         result = restAPI.sendTemplateSMS(mobile,model ,new String[]{mobile_rand,time});
  32.                 }catch(Exception e){
  33.                         result.put(shop_admin_userBean.statusCode, CodeConstant.CODE_0123);
  34.                         result.put(shop_admin_userBean.statusMsg, MessageConstant.CODE_0123);
  35.                 }
  36. //              result.put("statusCode", "000000");
  37.                 return result;
  38.         }
  39. }

回复 "发送手机验证码"

这儿你可以回复上面这条便签

captcha