九游会官网登录入口网页-ag8九游会j9登录入口允许用户自行修改源码或者增加源码来扩展系统服务,也可以包装功能更强的业务服务。本文主要介绍如何在九游会官网登录入口网页-ag8九游会j9登录入口中开发接口与外部系统进行数据交互。
1.在服务管理创建接口
2.以发起一个收文流程为例,接口内容如下:
/* //requesttext为外系统传入的参数:title,from,to等为传入的业务数据(根据实际情况调整),contents为正文数组对象,slaves为附件数组对象,没有的可以不传。 假设requesttext = { "title" : "关于某某某的九游会官网登录入口网页的公告(标题,必填)", "from" : "办公室(来文单位,必填)", "to" : "qhsnynctrsc(oa的部门人事处id,必填)", "date" : "2020-05-09(收文日期,选填)", "no" : "农123(字号,选填)", "key" : "nmt(文件加密私钥,选填,为空则认为没加密)", "contents" : [ { "filepath" : "http://host?file=aaaa.docx", "filename" : "aaaa.docx" } ], "slaves" : [ { "filepath" : "http://host?file=slaves.docx", "filename" : "slaves.docx" } ] } */ try{ var result = { } print( "requesttext=" requesttext ); var requestjson = json.parse(requesttext); if( typeof(requestjson) === "string" ){ requestjson = json.parse(requestjson); } if(requestjson.title === "" || requestjson.from === "" || requestjson.to === ""){//必填信息校验 result.state = "nmt0002"; result.message = "失败"; result.data = "标题或者来文单位或者oa部门id为空"; }else{ var processid = "d75fe1d2-6823-4e33-9798-6218d82f930f"; //需要启动的流程标识 var identity = "xxxxx@474820e2-4c54-4e5c-8c82-5915d5ca6d2c@i"; //启动人员身份 //传入的参数名和表单字段名不一致,所以重新拼接,subject,input_department,receive_date,input_file_no为流程表单字段标识 var datastr = '{"subject":"' requestjson.title '","input_department":"' requestjson.from '","receive_date":"' requestjson.date '","input_file_no":"' requestjson.no '"}'; datastr = json.parse(datastr); var applications = resources.getcontext().applications(); var data = { "title": requestjson.title, "identity": identity, "data" : datastr //表单数据 } var resp = applications.postquery('x_processplatform_assemble_surface', 'work/process/' processid, json.stringify( data )); //调用平台启动流程接口 var result1 = json.parse( resp.tostring() ); var workid = result1.data[0].work; //返回workid //上传附件-----------------------------------------------------------begin var token = gettoken(); //print( "contents个数:" requestjson.contents.length); //print( "slaves个数:" requestjson.slaves.length); var contentssite = "attachment"; //正文附件放置的附件区域 var slavessite = "attachment_1"; //普通附件放置的附件区域 //处理contents var conarr = requestjson.contents; for(var i=0;i
将流程数据传回外部系统
在服务管理创建接口,接口内容如下:
/* requesttext为入参 */ try{ var result = { } var pushdata = { } var requestjson = json.parse(requesttext); if( typeof(requestjson) === "string" ){ requestjson = json.parse(requestjson); } print( "workid=" requestjson.workid); //通过workid得到所有附件列表 var applications = resources.getcontext().applications(); var resp = applications.getquery('x_processplatform_assemble_surface', 'attachment/list/work/' requestjson.workid); var result1 = json.parse( resp.tostring() ); var dataarr = result1.data; var contentarr = []; var salvesarr = []; for(var i=0;i>>>>>>>>尝试对mac进行md5加密"); var md5util = java.type('com.z.custom.md5util'); var md5mac = md5util.getmd5( mac ); print( "md5mac = " md5mac ); var p3 = new namevaluepair('mac', md5mac); heads.add(p3) }catch(e){ print(e); } print(">>>>>headers:") var httpconnectionclass = java.type('com.x.base.core.project.connection.httpconnection'); var doccontent =json.stringify(pushdata); print("sendcontent:" doccontent); var resp = httpconnectionclass.postasstring(url, heads, doccontent); print("返回1:" resp.tostring()); if(resp.tostring()=='{"state":"nmt0001","message":"成功"}'){ this.response.setbody(true); }else{ this.response.setbody(false); } }catch(e){ e.printstacktrace(); result.state = "nmt0002"; result.message = "失败"; result.data = e.name ": " e.message this.response.setbody(false); } 说明
sso配置
gettoken()方法里面的sso名称和sso密钥配置在“系统设置”里
httpclientutilsupfile类代码
httpclientutilsupfile类代码如下:
package com.z.custom; import java.io.*; import java.net.*; import java.util.*; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import com.google.gson.jsonelement; import com.google.gson.jsonobject; import com.google.gson.jsonparser; import com.x.base.core.project.tools.crypto; import org.apache.http.httpentity; import org.apache.http.namevaluepair; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.closeablehttpresponse; import org.apache.http.client.methods.httpget; import org.apache.http.client.methods.httppost; import org.apache.http.entity.contenttype; import org.apache.http.entity.mime.multipartentitybuilder; import org.apache.http.entity.mime.content.filebody; import org.apache.http.entity.mime.content.inputstreambody; import org.apache.http.entity.mime.content.stringbody; import org.apache.http.impl.client.closeablehttpclient; import org.apache.http.impl.client.httpclients; import org.apache.http.message.basicnamevaluepair; import org.apache.http.util.entityutils; import javax.crypto.cipherinputstream; public class httpclientutilsupfile { public static final int thread_pool_size = 5; public interface httpclientdownloadprogress { public void onprogress(int prgetinstanceogress); } private static httpclientutilsupfile httpclientdownload; private executorservice downloadexcutorservice; private httpclientutilsupfile() { downloadexcutorservice = executors.newfixedthreadpool(thread_pool_size); } public static httpclientutilsupfile getinstance() { if (httpclientdownload == null) { httpclientdownload = new httpclientutilsupfile(); } return httpclientdownload; } /** * 下载文件 * * @param url * @param filepath */ public void download(final string url, final string filepath) { downloadexcutorservice.execute(new runnable() { public void run() { httpdownloadfile( url, filepath, null, null); } }); } /** * 下载文件 * * @param url * @param filepath * @param progress * */ public void download(final string url, final string filepath, final httpclientdownloadprogress progress) { downloadexcutorservice.execute(new runnable() { public void run() { httpdownloadfile(url, filepath, progress, null); } }); } /** *下载文件 * * @param url * @param filepath */ private void httpdownloadfile(string url, string filepath, httpclientdownloadprogress progress, mapheadmap) { closeablehttpclient httpclient = httpclients.createdefault(); try { httpget httpget = new httpget(url); setgethead(httpget, headmap); closeablehttpresponse response1 = httpclient.execute(httpget); try { httpentity httpentity = response1.getentity(); long contentlength = httpentity.getcontentlength(); inputstream is = httpentity.getcontent(); bytearrayoutputstream output = new bytearrayoutputstream(); byte[] buffer = new byte[4096]; int r = 0; long totalread = 0; while ((r = is.read(buffer)) > 0) { output.write(buffer, 0, r); totalread = r; if (progress != null) { progress.onprogress((int) (totalread * 100 / contentlength)); } } fileoutputstream fos = new fileoutputstream(filepath); output.writeto(fos); output.flush(); output.close(); fos.close(); entityutils.consume(httpentity); } finally { response1.close(); } } catch (exception e) { e.printstacktrace(); } finally { try { httpclient.close(); } catch (ioexception e) { e.printstacktrace(); } } } /** * 发送get请求 * * @param url * @return */ public string httpget(string url) { return httpget(url, null); } /** * 发送get请求 * * @param url * @return */ public string httpget(string url, map headmap) { string responsecontent = null; closeablehttpclient httpclient = httpclients.createdefault(); try { httpget httpget = new httpget(url); closeablehttpresponse response1 = httpclient.execute(httpget); setgethead(httpget, headmap); try { system.out.println(response1.getstatusline()); httpentity entity = response1.getentity(); responsecontent = getrespstring(entity); system.out.println("debug:" responsecontent); entityutils.consume(entity); } finally { response1.close(); } } catch (exception e) { e.printstacktrace(); } finally { try { httpclient.close(); } catch (ioexception e) { e.printstacktrace(); } } return responsecontent; } public string httppost(string url, map paramsmap) { return httppost(url, paramsmap, null); } /** * 发送post请求 * * @param url * @param paramsmap * @return */ public string httppost(string url, map paramsmap, map headmap) { string responsecontent = null; closeablehttpclient httpclient = httpclients.createdefault(); try { httppost httppost = new httppost(url); setposthead(httppost, headmap); setpostparams(httppost, paramsmap); closeablehttpresponse response = httpclient.execute(httppost); try { system.out.println(response.getstatusline()); httpentity entity = response.getentity(); responsecontent = getrespstring(entity); entityutils.consume(entity); } finally { response.close(); } } catch (exception e) { e.printstacktrace(); } finally { try { httpclient.close(); } catch (ioexception e) { e.printstacktrace(); } } system.out.println("responsecontent = " responsecontent); return responsecontent; } /** * 设置post请求的httpheader * * @param httppost * @param headmap */ private void setposthead(httppost httppost, map headmap) { if (headmap != null && headmap.size() > 0) { set keyset = headmap.keyset(); for (string key : keyset) { httppost.addheader(key, headmap.get(key)); } } } /** * 设置get请求的httpheader * * @param httpget * @param headmap */ private void setgethead(httpget httpget, map headmap) { if (headmap != null && headmap.size() > 0) { set keyset = headmap.keyset(); for (string key : keyset) { httpget.addheader(key, headmap.get(key)); } } } /** * 上传文件的实现方法 * * @param serverurl * @param localfilepath * @param serverfieldname * @param params * @return * @throws exception */ public string uploadfileimpl(string serverurl, string localfilepath,string serverfieldname, map params, map paramshead) throws exception { string respstr = null; closeablehttpclient httpclient = httpclients.createdefault(); try { httppost httppost = new httppost(serverurl); setposthead(httppost, paramshead); filebody binfilebody = new filebody(new file(localfilepath)); multipartentitybuilder multipartentitybuilder = multipartentitybuilder.create(); // add the file params multipartentitybuilder.addpart(serverfieldname, binfilebody); setuploadparams(multipartentitybuilder, params); httpentity reqentity = multipartentitybuilder.build(); httppost.setentity(reqentity); closeablehttpresponse response = httpclient.execute(httppost); try { httpentity resentity = response.getentity(); respstr = getrespstring(resentity); entityutils.consume(resentity); } finally { response.close(); } } finally { httpclient.close(); } system.out.println("resp=" respstr); return respstr; } /** * 上传文件的实现方法 * * @param serverurl * @param urlfilepath * @param urlfilename * @param serverfieldname * @param params * @return * @throws exception */ public string uploadurlfileimpl(string serverurl, string urlfilepath,string urlfilename,string serverfieldname, map params, map paramshead) throws exception { string respstr = null; closeablehttpclient httpclient = httpclients.createdefault(); try { httppost httppost = new httppost(serverurl); setposthead(httppost, paramshead); filebody binfilebody = new filebody(new file(urlfilepath)); multipartentitybuilder multipartentitybuilder = multipartentitybuilder.create(); // add the file params bufferedinputstream in = getfileinputstream(urlfilepath); inputstreambody inputstreambody = new inputstreambody(in,urlfilename); multipartentitybuilder.addpart(serverfieldname, inputstreambody); setuploadparams(multipartentitybuilder, params); httpentity reqentity = multipartentitybuilder.build(); httppost.setentity(reqentity); closeablehttpresponse response = httpclient.execute(httppost); try { system.out.println(response.getstatusline()); httpentity resentity = response.getentity(); respstr = getrespstring(resentity); entityutils.consume(resentity); } finally { response.close(); } } finally { httpclient.close(); } system.out.println("resp=" respstr); return respstr; } /** * 上传文件的实现方法 * 上传前 需要解密 * @param serverurl 上传附件服务 * @param urlfilepath 附件url * @param urlfilename 附件名称 * @param serverfieldname * @param params 附件参数 * @param paramshead 文件头 * @param skey 密钥 * @param siv 向量 * @return * @throws exception */ public string uploadbytefileimpl(string serverurl, string urlfilepath,string urlfilename,string serverfieldname, map params, map paramshead,string skey,string siv) throws exception { string respstr = null; closeablehttpclient httpclient = httpclients.createdefault(); try { httppost httppost = new httppost(serverurl); setposthead(httppost, paramshead); //ilebody binfilebody = new filebody(new file(urlfilepath)); multipartentitybuilder multipartentitybuilder = multipartentitybuilder.create(); // add the file params bufferedinputstream fis = getfileinputstream(urldecoder.decode(urlfilepath, "utf-8" ));; //解密 cipherinputstream cis = aesfile.decryptedfile(fis,skey,siv); if(cis != null){ //inputstream inputbytefile = new bytearrayinputstream(bytefile); //bufferedinputstream in = new bufferedinputstream(inputbytefile); inputstreambody inputstreambody = new inputstreambody(cis,urlfilename); multipartentitybuilder.addpart(serverfieldname, inputstreambody); setuploadparams(multipartentitybuilder, params); httpentity reqentity = multipartentitybuilder.build(); httppost.setentity(reqentity); closeablehttpresponse response = httpclient.execute(httppost); try { system.out.println(response.getstatusline()); httpentity resentity = response.getentity(); respstr = getrespstring(resentity); entityutils.consume(resentity); } finally { response.close(); } }else{ respstr = "解密失败"; } } finally { httpclient.close(); } system.out.println("resp=" respstr); return respstr; } /** * 设置上传时的参数 * * @param multipartentitybuilder * @param params */ private void setuploadparams(multipartentitybuilder multipartentitybuilder, map params) { if (params != null && params.size() > 0) { set keys = params.keyset(); for (string key : keys) { multipartentitybuilder.addpart(key, new stringbody(params.get(key),contenttype.application_json)); } } } /** * 获取响应内容 * * @param entity * @return * @throws exception */ private string getrespstring( httpentity entity ) throws exception { if (entity == null) { return null; } inputstream is = entity.getcontent(); stringbuffer strbuf = new stringbuffer(); byte[] buffer = new byte[4096]; int r = 0; while ((r = is.read(buffer)) > 0) { strbuf.append(new string(buffer, 0, r, "utf-8")); } return strbuf.tostring(); } /** * 设置post请求发送的参数 * * @param httppost * @param paramsmap * @throws exception */ private void setpostparams(httppost httppost, map paramsmap) throws exception { if (paramsmap != null && paramsmap.size() > 0) { list nvps = new arraylist (); set keyset = paramsmap.keyset(); for (string key : keyset) { nvps.add(new basicnamevaluepair(key, paramsmap.get(key))); } httppost.setentity(new urlencodedformentity(nvps)); } } /** * 发送post请求 * @param url * @param param * @return */ public static string sendpost(string url, string param) { printwriter out = null; bufferedreader in = null; string result = ""; try { url realurl = new ; urlconnection conn = realurl.openconnection(); conn.setrequestproperty("accept", "*/*"); conn.setrequestproperty("connection", "keep-alive"); conn.setrequestproperty("content-type", "application/json; charset=utf-8"); conn.setrequestproperty("user-agent", "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1;sv1)"); conn.setdooutput(true); conn.setdoinput(true); out = new printwriter(conn.getoutputstream()); out.print(param); out.flush(); in = new bufferedreader( new inputstreamreader(conn.getinputstream())); string line; while ((line = in.readline()) != null) { result = line; } } catch (exception e) { system.out.println(" post" e); e.printstacktrace(); } finally{ try{ if(out!=null){ out.close(); } if(in!=null){ in.close(); } } catch(ioexception ex){ ex.printstacktrace(); } } system.out.println(result); return result; } /** * 根据ssotoken获取人员认证后的真实xtoken * @param url * @param client * @param login_uid * @param sso_key * @return */ public string gettoken(string url, string client, string login_uid, string sso_key ) { long time = new date().gettime(); string xtoken = null; try { xtoken = crypto.encrypt( login_uid "#" time, sso_key ); system.out.println(xtoken); } catch (exception e1) { e1.printstacktrace(); } string string = "{"token": " xtoken ", "client": "" client ""}"; string str = getinstance().sendpost( url,string ); system.out.println("sso response: " str ); try { jsonelement jsonobj = new jsonparser().parse(str); if( jsonobj != null && jsonobj.getasjsonobject().get("data") != null ){ jsonobject data = jsonobj.getasjsonobject().get("data").getasjsonobject(); system.out.println("gettoken: " data.get("token")); return data.get("token").getasstring(); } } catch (exception e) { e.printstacktrace(); } return null; } private bufferedinputstream getfileinputstream(string urlpath) { bufferedinputstream bin=null; url url; try { url = new ; urlconnection urlconnection = url.openconnection(); httpurlconnection httpurlconnection = (httpurlconnection) urlconnection; httpurlconnection.setconnecttimeout(1000*5); httpurlconnection.setrequestmethod("get"); // 设置字符编码 httpurlconnection.setrequestproperty("charset", "utf-8"); httpurlconnection.connect(); bin = new bufferedinputstream(httpurlconnection.getinputstream()); } catch (exception e) { e.printstacktrace(); } return bin; } private inputstream getinputstream(string urlpath) { inputstream bin=null; url url; try { url = new ; urlconnection urlconnection = url.openconnection(); httpurlconnection httpurlconnection = (httpurlconnection) urlconnection; httpurlconnection.setconnecttimeout(1000*5); httpurlconnection.setrequestmethod("get"); // 设置字符编码 httpurlconnection.setrequestproperty("charset", "utf-8"); httpurlconnection.connect(); bin = httpurlconnection.getinputstream(); } catch (exception e) { e.printstacktrace(); } return bin; } public static void main(string[] args) throws ioexception, exception { } } aes加解密
aesfile类代码:
package com.z.custom; import org.bouncycastle.jce.provider.bouncycastleprovider; import sun.misc.base64decoder; import javax.crypto.cipher; import javax.crypto.cipherinputstream; import javax.crypto.keygenerator; import javax.crypto.nosuchpaddingexception; import javax.crypto.spec.ivparameterspec; import javax.crypto.spec.secretkeyspec; import java.io.*; import java.security.*; import java.util.random; public class aesfile { @suppresswarnings("static-access") //文件加密的实现方法 public static void encryptfile2(string filename,string encryptedfilename,string skey,string siv){ try { //导入支持aes/cbc/pkcs7padding的provider security.addprovider(new bouncycastleprovider()); fileinputstream fis = new fileinputstream(filename); fileoutputstream fos = new fileoutputstream(encryptedfilename); byte[] keyvalue = skey.getbytes(); secretkeyspec encrykey= new secretkeyspec(keyvalue,"aes");//加密秘钥 //byte[] ivvalue=new byte[16]; byte[] ivvalue = siv.getbytes(); random random = new random(system.currenttimemillis()); random.nextbytes(ivvalue); ivparameterspec iv = new ivparameterspec(ivvalue);//获取系统时间作为iv fos.write(ivvalue); //记录iv cipher cipher = cipher.getinstance("aes/cbc/pkcs7padding","bc"); cipher.init(cipher.encrypt_mode, encrykey,iv); cipherinputstream cis=new cipherinputstream(fis, cipher); byte[] buffer=new byte[1024]; int n=0; while((n=cis.read(buffer))!=-1){ fos.write(buffer,0,n); } cis.close(); fos.close(); } catch (invalidkeyexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (nosuchalgorithmexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (nosuchpaddingexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (invalidalgorithmparameterexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (nosuchproviderexception e) { e.printstacktrace(); } } @suppresswarnings("static-access") //文件解密的实现代码 通过文件流 public static cipherinputstream decryptedfile(inputstream fis,string skey, string siv){ try { //导入支持aes/cbc/pkcs7padding的provider security.addprovider(new bouncycastleprovider()); byte[] keyvalue = skey.getbytes(); secretkeyspec key= new secretkeyspec(keyvalue,"aes"); byte[] ivvalue = siv.getbytes(); //fis.read(ivvalue);//获取iv值 ivparameterspec iv= new ivparameterspec(ivvalue); cipher cipher = cipher.getinstance("aes/cbc/pkcs7padding","bc"); cipher.init(cipher.decrypt_mode, key,iv); cipherinputstream cis= new cipherinputstream(fis, cipher); return cis; } catch (nosuchalgorithmexception e) { e.printstacktrace(); return null; } catch (invalidkeyexception e) { e.printstacktrace(); return null; } catch (invalidalgorithmparameterexception e) { e.printstacktrace(); return null; } catch (nosuchpaddingexception e) { e.printstacktrace(); return null; } catch (nosuchproviderexception e) { e.printstacktrace(); return null; } } @suppresswarnings("static-access") //文件解密的实现代码 public static void decryptedfile2(string encryptedfilename,string decryptedfilename, string skey, string siv){ try { //导入支持aes/cbc/pkcs7padding的provider security.addprovider(new bouncycastleprovider()); fileinputstream fis = new fileinputstream(encryptedfilename); fileoutputstream fos = new fileoutputstream(decryptedfilename); base64decoder decoder = new base64decoder(); //byte[] fileidentifier=new byte[15]; //byte[] keyvalue=new byte[16]; //string skey= "12345678123456781234567812345678"; byte[] keyvalue = skey.getbytes(); //fis.read(keyvalue);//读记录的文件加密密码的消息摘要 //fis.read(fileidentifier); //system.out.println("file==" new string(fileidentifier,"utf-8")); //if(new string (fileidentifier).equals("myfileencryptor")){ secretkeyspec key= new secretkeyspec(keyvalue,"aes"); //byte[] ivvalue= new byte[16]; //string siv = "1234567812345678"; byte[] ivvalue = siv.getbytes(); //fis.read(ivvalue);//获取iv值 ivparameterspec iv= new ivparameterspec(ivvalue); cipher cipher = cipher.getinstance("aes/cbc/pkcs7padding","bc"); cipher.init(cipher.decrypt_mode, key,iv); cipherinputstream cis= new cipherinputstream(fis, cipher); byte[] buffer=new byte[1024]; int n=0; while((n=cis.read(buffer))!=-1){ fos.write(buffer,0,n); } cis.close(); fos.close(); //joptionpane.showmessagedialog(null, "解密成功"); //}else{ //joptionpane.showmessagedialog(null, "文件不是我加密的,爱找谁着谁去"); //} } catch (ioexception e) { e.printstacktrace(); } catch (nosuchalgorithmexception e) { e.printstacktrace(); } catch (invalidkeyexception e) { e.printstacktrace(); } catch (invalidalgorithmparameterexception e) { e.printstacktrace(); } catch (nosuchpaddingexception e) { e.printstacktrace(); } catch (nosuchproviderexception e) { e.printstacktrace(); } } }md5加密
package com.z.custom; import org.apache.commons.codec.digest.digestutils; import java.math.biginteger; import java.security.messagedigest; /** * md5通用类 * */ public class md5util { public static string getmd5(string str) { try { // 生成一个md5加密计算摘要 messagedigest md = messagedigest.getinstance("md5"); // 计算md5函数 md.update(str.getbytes()); // digest()最后确定返回md5 hash值,返回值为8为字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 // biginteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 string md5=new biginteger(1, md.digest()).tostring(16); //biginteger会把0省略掉,需补全至32位 return fillmd5(md5); } catch (exception e) { throw new runtimeexception("md5加密错误:" e.getmessage(),e); } } public static string fillmd5(string md5){ return md5.length()==32?md5:fillmd5("0" md5); } /** * md5方法 * * @param text 明文 * @param key 密钥 * @return 密文 * @throws exception */ public static string md5(string text, string key) throws exception { //加密后的字符串 string encodestr=digestutils.md5hex(text key); system.out.println("md5加密后的字符串为:encodestr=" encodestr); return encodestr; } /** * md5验证方法 * * @param text 明文 * @param key 密钥 * @param md5 密文 * @return true/false * @throws exception */ public static boolean verify( string text, string key, string md5) throws exception { //根据传入的密钥进行验证 string md5text = md5(text, key); if(md5text.equalsignorecase(md5)) { system.out.println("md5验证通过"); return true; } return false; } public static void main(string[] args) throws exception{ string str = "lee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81glee81g"; system.out.println("md5:" getmd5(str)); system.out.println("length:" getmd5(str).length()); } }搭建自定义工程
以上所用到的java类不包含在平台源码中,需要以自定义工程的方式注入到平台中进行使用,搭建自定义工程及开发参考教程: