zhibing.pu
2024-04-15 32f02d85b75f94ae0b704c7be059c5b0ff043095
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SMSUtil.java
@@ -283,7 +283,7 @@
     * @return
     */
    public boolean sendCellulantMessage(String toPhone, String msg){
        String url = "https://sms.nalosolutions.com/smsbackend/Nal_resl/send-message/";
        String url = "https://sms.nalosolutions.com/smsbackend/clientapi/Cell_resl/send-message/";
        HttpRequest post = HttpUtil.createPost(url);
        post.contentType(ContentType.JSON.toString());
        JSONObject params = new JSONObject();
@@ -297,12 +297,16 @@
        execute.close();
        JSONObject jsonObject = JSON.parseObject(body);
        Integer status = jsonObject.getInteger("status");
        if(1701 == status){
        if(null != status && 1701 == status){
            return true;
        }else{
            System.err.println("短信发送失败:" + jsonObject.toJSONString());
            return false;
        }
    }
    public static void main(String[] ages){
        SMSUtil smsUtil = new SMSUtil();
        smsUtil.sendCellulantMessage("233244915521", "您的验证码为:123456,该验证码5分钟内有效,请勿泄漏于他人!");
    }
}