验证码生成

自动生成用户可控复杂度的验证码以及验证码图片


请求地址:http://api.xiaocongjisuan.com/develop/verificationcode/get
返回格式:json/xml
请求方式:http/https; get/post
参数示例:appKey=yours&openId=yours&w=200&h=50&len=7&fontSize=40
请求参数说明:
名称类型必填说明
appKeyString接口唯一标识,在用户后台->应用中心->我的接口查看
openIdString平台id,注册后系统自动生成,在用户后台->用户中心->账户信息查看
dTypeString返回类型,json/xml,默认为json,区分大小写
wInteger验证码图片宽度,单位px
hInteger验证码图片高度,单位px
lenInteger验证码长度,3-15位之间
fontSizeInteger验证码字体大小,默认40
fontColorString字体颜色,合法值: r,g,b 或者 white,black,blue.
backgroundFromString背景颜色渐变,开始颜色,合法值: r,g,b 或者 white,black,blue.
backgroundToString背景颜色渐变, 结束颜色,合法值: r,g,b 或者 white,black,blue.
noiseColorString干扰 颜色,合法值: r,g,b 或者 white,black,blue.
styleString图片样式,水纹、鱼眼 、 阴影 共三个值:water、fishEye、shadow
返回结果说明:
名称类型说明
errorCodeInteger错误码,请参看错误码解释
errorString错误标识
errorMessageString错误提示
capTextString验证码
capBase64PicString验证码图片,base64格式
json返回示例:
{
	"data": {
		"capText": "mxny763",
		"capBase64Pic": "data:image/jpg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAyAMgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZ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eMUAY3h291N9NWOz0tHGAPMlnCjGPTGSCcn8TXN62L2z1oNcGNJgcgRqdo54xuGDxgfQCvR9H0qLSrfyIXcx8Haxzg9yPrWfrHhP8AtfVBcGTCbQMAldp9ehB+mB9fUAs2vh06np8b3us6jOskYJRZVRDx3C5z+ZrmvDnh+Bdeura7tVulikEagkBR3yc/yFdxqE97Y2lv9itpLhwQGjjUHIA7k4Ao0fTmbVpr+aExSOAdjbTjr3IyDyOh7fhQB0NpawWyBIIY4l9EUKP0rj7u72ePoIZc/Z2K7x1+4dysD1B3nbjHIruIxWdd+F7G/wBatdVcutzARgg5BAzgYPuc/higDcmtYry1ktp13RSqUZfUGuL8DibwtrN14c1JiBM4mtJCMLISPmx+QrvIxRdada6jCIrqESKDkHkFT6gjkH6UAea/F+NjqOhPAcXAdlGOuSVx/Kuxk8YXsfxHs/Doso1s5od7StnfkrnjnGM4GMVZTwRpcmrw6lcvdXUsPMS3EpdV/wAfxrcv9B0zWDG1/ZxzPH9x+Qy/RhyKAOV+K9yLnwwNCtEa41G9lj8uGMZYKGzuPoOMfjXX+CtIm0Lwhpmm3BzNBFh/qSSR+tWNO0XTdNJazsoYnb70gXLt9WPJ/E1rxigCeMVajFQRirUYoAnjFFOjFFAHwzHVqOiigC1HVmOiigC1HVqPtRRQBZjq1HRRQBajqzHRRQBajqzHRRQBajq1HRRQBZjq1HRRQBaj7VZjoooAtR1ajoooAsx1ajoooAsx1ajoooAtR0UUUAf/2Q=="
	},
	"errorMessage": "成功",
	"errorCode": 0,
	"error": "success"
}
xml返回示例:
<Map> 
  <data> 
    <capText>ywmd7db</capText>  
    <capBase64Pic>data:image/jpg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj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6tR0UUAWo6KKKAP//Z</capBase64Pic> 
  </data>  
  <errorMessage>成功</errorMessage>  
  <errorCode>0</errorCode>  
  <error>success</error> 
</Map>
全部评论
系统级错误码列表:
错误码 错误标识 错误提示
0 success 成功
1 fail 失败
2 pass 通过
3 data_allow 允许返回数据
10001 error_appkey 错误的appkey
10002 appkey_killed appkey被封杀
10003 api_exceed_max_limit 接口使用超过日最大限额,有可能威胁服务器安全
10004 api_exceed_limit 接口访问次数耗尽,请及时续费
10005 ip_illegal 该ip没有请求权限,请检查白名单设置
10006 ip_exceed_max_limit 当前ip请求超过限制
10007 ip_killed 当前ip被封杀
10008 error_openid 错误的openid
10009 openid_killed 该openid没有请求权限
10010 api_maintenance 接口维护
10011 api_closed 接口停用
10012 server_inner_error 服务器内部错误
10013 your_api_closed 该接口设置了关闭,请到用户后台查看
10014 your_api_not_bind_app 系统要求接口至少绑定一个应用,请到用户后台绑定
10015 do_not_authenticate 您的账户没有认证
接口具体错误返回码列表:
错误码 错误标识 错误提示
20001 width_is_illegal 验证码宽度不合法,大于24,小于801
20002 height_is_illegal 验证码高度不合法,大于24,小于801
20003 length_is_illegal 验证码长度不合法,大于2,小于16
20004 style_is_illegal 验证码样式需为几个固定修饰词
20005 paramter_is_error 传入参数非法,没法生成对应内容
JAVA
package com.xiaocongjisuan.module.example;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

public class Application {
	
	 public static final String DEF_CHATSET = "UTF-8";
	 public static final int DEF_CONN_TIMEOUT = 30000;
	 public static final int DEF_READ_TIMEOUT = 30000;
	 public static String userAgent =  "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36";
	 
	 //配置您申请的appKey和openId
	 public static final String APP_KEY ="yours";
	 public static final String OPEN_ID ="yours";
	 
	 //将map型转为请求参数型
     public static String urlEncode(Map<String,Object> params) {
        
    	if(params==null){return "";};
    	 
    	StringBuilder sb = new StringBuilder();
        for (Map.Entry<String,Object> i : params.entrySet()) {
            try {
                sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue()+"","UTF-8")).append("&");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
        }
        String r=sb.toString();
        if(r.endsWith("&")){
        	r = r.substring(0,r.length()-1);
        }
        return r;
     }
     
     /**
     *
     * @param requestUrl 请求地址
     * @param params 请求参数
     * @param method 请求方法
     * @return 请求结果
     * @throws Exception
     */
     public static String requestContent(String requestUrl, Map<String,Object> params,String method) throws Exception {
        
    	HttpURLConnection conn = null;
        BufferedReader reader = null;
        String rs = null;
        try {

        	//组装请求链接
            StringBuffer sb = new StringBuffer();
            
            if(method!=null&&method.equalsIgnoreCase("get")){
            	requestUrl = requestUrl+"?"+urlEncode(params);
            }

            //默认get
            URL url = new URL(requestUrl);
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            
            if(method!=null&&method.equalsIgnoreCase("post")){
            	 conn.setRequestMethod("POST");
                 conn.setDoOutput(true);
                 conn.setDoInput(true);
            }

            //参数配置
            conn.setRequestProperty("User-agent", userAgent);
            conn.setUseCaches(false);
            conn.setConnectTimeout(DEF_CONN_TIMEOUT);
            conn.setReadTimeout(DEF_READ_TIMEOUT);
            conn.setInstanceFollowRedirects(false);
            conn.connect();
            
            if (params!= null && method.equalsIgnoreCase("post")) {
                try {
                    DataOutputStream out = new DataOutputStream(conn.getOutputStream());
                    out.writeBytes(urlEncode(params));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            
            //读取数据
            InputStream is = conn.getInputStream();
            reader = new BufferedReader(new InputStreamReader(is, DEF_CHATSET));
            String strRead = null;
            while ((strRead = reader.readLine()) != null) {
                sb.append(strRead);
            }
            rs = sb.toString();
            
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (reader != null) {
                reader.close();
            }
            if (conn != null) {
                conn.disconnect();
            }
        }
        return rs;
    }
	
	
	public static void main(String[] args) throws Exception{
		
		String domain="http://api.xiaocongjisuan.com/";
		String servlet="develop/verificationcode/get";
		String method="get";
		
		String requestUrl=domain+servlet;
		Map<String,Object> params=new HashMap<String,Object>();
		params.put("appKey",APP_KEY);
		params.put("openId",OPEN_ID);

		//变动部分
		params.put("w",200);
		params.put("h",50);
		params.put("len",7);
		params.put("fontSize",40);
		
		String result=requestContent(requestUrl,params,method);
		System.out.println(result);
	}
}
PYTHON
# -*- coding: utf-8 -*-
# flake8: noqa
__author__ = 'wukong'

import urllib
from urllib import urlencode

#配置您申请的appKey和openId
app_key="***"
open_id="***"

"""
request_url 请求地址
params 请求参数
method 请求方法

"""
def request_content(request_url,params,method):
    params = urlencode(params)
    
    if method and method.lower() =="get":
        f = urllib.urlopen("%s?%s" % (request_url, params))
    else:
        f = urllib.urlopen(request_url, params)
 
    content = f.read()
    print content

   
def main():
    
    domain="http://api.xiaocongjisuan.com/";
    servlet="develop/verificationcode/get"
    method="get"
    request_url=domain+servlet
    
    #字典
    params ={}
    params["appKey"]=app_key
    params["openId"]=open_id
    
    #变动部分
    params["w"]=200
    params["h"]=50
    params["len"]=7
    params["fontSize"]=40
    
    request_content(request_url,params,method)
    
if __name__ == '__main__':
    main()
PHP
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<?php

/**
 * @author 
 * @copyright 2019
 */
 
header("content-type:text/html;charset=utf-8");         //设置编码
 
//配置您申请的appKey和openId
$app_key = "***";
$open_id = "***";

/**
$url 请求地址
$params 请求参数
$ispost 请求方法
*/

function http_curl($url,$params=false,$ispost=false){
   
    $httpInfo = array();
    $ch = curl_init();

    curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
    curl_setopt( $ch, CURLOPT_USERAGENT , "xiaocongjisuan");
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 60 );
    curl_setopt( $ch, CURLOPT_TIMEOUT , 60);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );
    
    if( $ispost )
    {
        curl_setopt( $ch , CURLOPT_POST , true );
        curl_setopt( $ch , CURLOPT_POSTFIELDS , $params );
        curl_setopt( $ch , CURLOPT_URL , $url );
    }
    else
    {
        if($params){
            curl_setopt( $ch , CURLOPT_URL , $url.'?'.$params );
        }else{
            curl_setopt( $ch , CURLOPT_URL , $url);
        }
    }
    
    $response = curl_exec( $ch );
    if ($response === FALSE) {
        //echo "cURL Error: " . curl_error($ch);
        return false;
    }
    $httpCode = curl_getinfo( $ch , CURLINFO_HTTP_CODE );
    $httpInfo = array_merge( $httpInfo , curl_getinfo( $ch ) );
    curl_close( $ch );
    
    return $response;
}

function main(){
    
    global $app_key;
    global $open_id;
    
    $domain="http://api.xiaocongjisuan.com/";
    $servlet="develop/verificationcode/get";
    $method="get";
    
    $url=$domain."".$servlet;
    
    $params['appKey']=$app_key;
    $params['openId']=$open_id;
    
    //变动部分
    $params["w"]=200;
    $params["h"]=50;
    $params["len"]=7;
    $params["fontSize"]=40;
    
    //编码转换
    foreach ($params as $key=>$value) {
        $params[$key]=mb_convert_encoding($value, "UTF-8", "GBK");
    }

    $paramstring = http_build_query($params);
    $content = http_curl($url,$paramstring,true);
    
    return $content;
}

echo main();
?>
C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        private static string appKey="yours";
        private static string openId = "yours";
       
        static string getResponseAsString(HttpWebResponse rsp, Encoding encoding)
        {
            System.IO.Stream stream = null;
            StreamReader reader = null;
            try
            {
                // 以字符流的方式读取HTTP响应
                stream = rsp.GetResponseStream();
                reader = new StreamReader(stream, encoding);
                return reader.ReadToEnd();
            }
            finally
            {
                // 释放资源
                if (reader != null) reader.Close();
                if (stream != null) stream.Close();
                if (rsp != null) rsp.Close();
            }
        }

        /*
         * parameters 参数
         * encode 编码
         */

        static string buildQuery(IDictionary<string,object> parameters, string encode)
        {
            StringBuilder postData = new StringBuilder();
            bool hasParam = false;
            IEnumerator<KeyValuePair<string, object>> dem = parameters.GetEnumerator();
            while (dem.MoveNext())
            {
                string name = dem.Current.Key;
                string value = dem.Current.Value.ToString(); ;
                // 忽略参数名或参数值为空的参数
                if (!string.IsNullOrEmpty(name))//&& !string.IsNullOrEmpty(value)
                {
                    if (hasParam)
                    {
                        postData.Append("&");
                    }
                    postData.Append(name);
                    postData.Append("=");
                    if (encode == "gb2312")
                    {
                        postData.Append(System.Web.HttpUtility.UrlEncode(value, Encoding.GetEncoding("gb2312")));
                    }
                    else if (encode == "utf8")
                    {
                        postData.Append(System.Web.HttpUtility.UrlEncode(value, Encoding.UTF8));
                    }
                    else
                    {
                        postData.Append(value);
                    }
                    hasParam = true;
                }
            }
            return postData.ToString();
        }


        /**
        *
        * @param url 请求地址
        * @param params 请求参数
        * @param method 请求方法
        * @return 请求结果
        * @throws Exception
        */
        static string requestContent(string url, IDictionary<string,object> parameters, string method)
        {
            if (method.ToLower() == "post")
            {
                HttpWebRequest req = null;
                HttpWebResponse rsp = null;
                System.IO.Stream reqStream = null;
                try
                {
                    req = (HttpWebRequest)WebRequest.Create(url);
                    req.Method = method;
                    req.KeepAlive = false;
                    req.ProtocolVersion = HttpVersion.Version10;
                    req.Timeout = 5000;
                    req.ContentType = "application/x-www-form-urlencoded;charset=utf-8";
                    byte[] postData = Encoding.UTF8.GetBytes(buildQuery(parameters, "utf8"));
                    reqStream = req.GetRequestStream();
                    reqStream.Write(postData, 0, postData.Length);
                    rsp = (HttpWebResponse)req.GetResponse();
                    Encoding encoding = Encoding.GetEncoding(rsp.CharacterSet);
                    return getResponseAsString(rsp, encoding);
                }
                catch (Exception ex)
                {
                    return ex.Message;
                }
                finally
                {
                    if (reqStream != null) reqStream.Close();
                    if (rsp != null) rsp.Close();
                }
            }
            else
            {
                //创建请求
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url + "?" + buildQuery(parameters, "utf8"));

                //GET请求
                request.Method = "GET";
                request.ReadWriteTimeout = 5000;
                request.ContentType = "text/html;charset=UTF-8";
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                Stream myResponseStream = response.GetResponseStream();
                StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));

                //返回内容
                string retString = myStreamReader.ReadToEnd();
                return retString;
            }
        }

        static void Main(string[] args)
        {

            String domain = "http://api.xiaocongjisuan.com/";
            String servlet = "develop/verificationcode/get";
            String method = "get";
            String url = domain + servlet;


            var parameters = new Dictionary<string,object>();

            parameters.Add("appKey", appKey);
            parameters.Add("openId", openId);

            //变动部分
            parameters.Add("w", 200);
            parameters.Add("h", 50);
            parameters.Add("len", 7);
            parameters.Add("fontSize", 40);

            string result = requestContent(url, parameters, method);
            Console.WriteLine(result);
            Console.Read();

        }

    }
}

GO
package main

import (
    "io/ioutil"
    "net/http"
    "net/url"
    "fmt"
	"strings"
)
 
//配置您申请的appKey和openId
const APP_KEY ="yours";
const OPEN_ID ="yours";

func requestContent(requestUrl string,params url.Values,method string)(rs[]byte ,err error){
	
	if strings.ToUpper(method)=="GET"{
		return get(requestUrl,params)
	}
	return post(requestUrl,params)
}

// get 网络请求
func get(requestUrl string,params url.Values)(rs[]byte ,err error){
    var Url *url.URL
    Url,err=url.Parse(requestUrl)
    if err!=nil{
        fmt.Printf("解析url错误:\r\n%v",err)
        return nil,err
    }
    //如果参数中有中文参数,这个方法会进行URLEncode
    Url.RawQuery=params.Encode()
    resp,err:=http.Get(Url.String())
    if err!=nil{
        fmt.Println("err:",err)
        return nil,err
    }
    defer resp.Body.Close()
    return ioutil.ReadAll(resp.Body)
}
 
// post 网络请求 ,params 是url.Values类型
func post(requestUrl string, params url.Values)(rs[]byte,err error){
    resp,err:=http.PostForm(requestUrl, params)
    if err!=nil{
        return nil ,err
    }
    defer resp.Body.Close()
    return ioutil.ReadAll(resp.Body)
}

func main(){

	domain :="http://api.xiaocongjisuan.com/"

	servlet :="develop/verificationcode/get"
	method :="get"
	requestUrl:=domain+servlet
	
    //初始化参数
    params:=url.Values{}
	
	params.Set("appKey",APP_KEY)
	params.Set("openId",OPEN_ID)
	
	//变动部分
	params.Set("w","200")
	params.Set("h","50")
	params.Set("len","7")
	params.Set("fontSize","40")
 
 
    //发送请求
    data,err:=requestContent(requestUrl,params,method)
    fmt.Println(string(data))
	if err!=nil{
        fmt.Printf("解析url错误:\r\n%v",err)
    }
}	
NODEJS
var http = require('http'); 
var qs = require('querystring'); 

//配置您申请的appKey和openId
app_key = "***";
open_id = "***";
 
function request_content(request_url,port,params,method){
	
	var path=request_url;
	if(!!params){
		var content = qs.stringify(params);  
		path=request_url+'?' + content;
	}
	
	var options = { 
		port: port,
		path: path,
		method: method
	}; 
	
	if(method.toLowerCase()=='post'){
		options['headers']="Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8";
	}

	var req = http.request(options, function (res) { 
		res.setEncoding('utf8'); 
		res.on('data', function (chunk) { 
			console.log(chunk); 
		}); 
	});  
	
	req.on('error', function (e) { 
		console.log('problem with request: ' + e.message); 
	}); 
	
	req.end();
}

function main(){

	var domain="http://api.xiaocongjisuan.com/";
	var port=8080;//http对应80端口,https 对应443端口,请使用者自己改正
	var servlet="develop/verificationcode/get";
	var method="get";
	var request_url=domain+servlet;

	var params = {}; 
	params['appKey']=app_key;
    params['openId']=open_id;
	
	//变动部分
    params["w"]=200;
    params["h"]=50;
    params["len"]=7;
    params["fontSize"]=40;
	
	request_content(request_url,port,params,method);
}

main();