WeChat? ?? ??? ?? ??? ??? ?? ? ?? ?? ??? ???? ?? ? ?? ?? ??? ???? ?????. ?? ?? WeChat? ?? ??? ?? ??? ???? ?? Java ??? ?????. ?????, nonceStr ? ??? ? ?? ????? ?? ? ??? ?? ?? ??? ????. ? ????? ? ? ?? ????? ? ???? ???? WeChat jsapi? ????? ???? ?? ???? ????. .
?? ??:
package com.test.util; import java.util.UUID; import java.util.Map; import java.util.HashMap; import java.util.Formatter; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.io.UnsupportedEncodingException; public class Sign { public static void main(String[] args) { String jsapi_ticket =JsapiTicketUtil.getJSApiTicket();; // 注意 URL 一定要動態(tài)獲取,不能 hardcode String url = "http://www.vxzsk.com/xx/x.do";//url是你請求的一個action或者controller地址,并且方法直接跳轉(zhuǎn)到使用jsapi的jsp界面 Map<String, String> ret = sign(jsapi_ticket, url); for (Map.Entry entry : ret.entrySet()) { System.out.println(entry.getKey() + ", " + entry.getValue()); } }; public static Map<String, String> sign(String jsapi_ticket, String url) { Map<String, String> ret = new HashMap<String, String>(); String nonce_str = create_nonce_str(); String timestamp = create_timestamp(); String string1; String signature = ""; //注意這里參數(shù)名必須全部小寫,且必須有序 string1 = "jsapi_ticket=" + jsapi_ticket + "&noncestr=" + nonce_str + "×tamp=" + timestamp + "&url=" + url; System.out.println(string1); try { MessageDigest crypt = MessageDigest.getInstance("SHA-1"); crypt.reset(); crypt.update(string1.getBytes("UTF-8")); signature = byteToHex(crypt.digest()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } ret.put("url", url); ret.put("jsapi_ticket", jsapi_ticket); ret.put("nonceStr", nonce_str); ret.put("timestamp", timestamp); ret.put("signature", signature); return ret; } private static String byteToHex(final byte[] hash) { Formatter formatter = new Formatter(); for (byte b : hash) { formatter.format("%02x", b); } String result = formatter.toString(); formatter.close(); return result; } private static String create_nonce_str() { return UUID.randomUUID().toString(); } private static String create_timestamp() { return Long.toString(System.currentTimeMillis() / 1000); } } |
16th A ?? ???? ?? url? ??? ?? ?? ???? ???? ???? jsapi
? ???? jsp ?????? ?? ???? jsapi_ticket ?? ???? ????. ??:
??? ??? myeclipse ?? Eclipse? ?? ???? ?? ???? ??? ? ??? ??? ??? ????. JsapiTicketUtil?? access_token? ?? ???? ??? ??? appid? appsecret? ???? ???. ? ??? WeChat ?????, nonceStr, ?? ??? ?? ?? WeChat ??? Java? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????! ? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.
![]() ? AI ??![]() Undress AI Tool??? ???? ?? ![]() Undresser.AI Undress???? ?? ??? ??? ?? AI ?? ? ![]() AI Clothes Remover???? ?? ???? ??? AI ?????. ![]() Clothoff.ioAI ? ??? ![]() Video Face Swap??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????! ![]() ?? ??
?? ?? ?? ??? | Uma Musume Pretty Derby
1 ? ? ?
By Jack chen
<night> : ???? 99 ? - ?? ?? ? ?? ?? ??
1 ? ? ?
By DDD
?? ? ??? ????? Rimworld Odyssey ?? ???
3 ? ? ?
By Jack chen
Mejiro Ryan ?? ??? | Uma Musume Pretty Derby
4 ? ? ?
By Jack chen
Rimworld Odyssey ?? ??
3 ? ? ?
By Jack chen
![]() ??? ??![]() ???++7.3.1???? ?? ?? ?? ??? ![]() SublimeText3 ??? ????? ??, ???? ?? ????. ![]() ???? 13.0.1 ?????? PHP ?? ?? ?? ![]() ???? CS6??? ? ?? ?? ![]() SublimeText3 Mac ??? ??? ?? ?? ?????(SublimeText3) ![]() PHP? ? ?? ? ?? ? ?????, ?? WeChat ??? ?? ???? ?? ?? ???? ?????. ??? ?? ? ?? ??? ???? WeChat ??? PHP? ???? ???? ????. PHP? ??? ?? ???? ?? ?? ???? ?????. WeChat ???? ??? ??? ? ???? ??? ??? ???? ?? ??? ?? ??? ?????. ??? ? ??? ??? ?? ???? ?? ??? ?? ???? ??? ? ?? ????? ??? ? ? ????. ![]() WeChat ?? ??? ??? ? ?? ??? ?? ?????. ?? ??? ????? ?? ??? ??? ??? ? ?? ?? ????, ??? ?? ? ?? ??? ?? ??? ????? ???. ? ????? PHP? ???? WeChat ?? ??? ???? ??? ?????. WeChat ?? ?? ??? ???? ?? WeChat ?? ?? ??? ??? ???. WeChat ?? ?????? WeChat ?? ??, ?? ?? ? ?? ??? ???? ??? API ??? ???? ???. PHP ??? ???? ???? ???? WeChat?? ????? ???? PH? ???? ???. ![]() WeChat? ??? ?? ?? ? ?? ??? WeChat? ??? ??? ???? ??????. WeChat ?? ??? ??? ??? WeChat ???? ???? ??? ?? ? ?????. ??? ?? ???? ????? ??? ?????? ?? ??? ?? ??? ?? ?????. ??? WeChat ?? ??? ??? ???? ?? ?? ?????. ? ????? PHP? ???? WeChat ?? ??? ??? ???? ??? ?????. 1. ?? ?? WeChat ?? ??? ??? ????? ?? ?? ??? ???? ???. PHP WeChat ?? ??? ??? ?? ?? ?? ?? ??: Sub ![]() WeChat? ?? ???? ?? ? ??? ??? ??? ?? ??? ? ?????. ??? ???? ??? ?? ?? ? ?? ???? WeChat ???? ???? ??? ??????. WeChat ???? ??? ? ?? ???? ??? ?????. ?? ??? ?? ?? ? ? ???? ?? WeChat ??? PHP ??? ??? ? ????. 1. PHP ?? WeChat ?? PHP? ? ?? ???? ?? ???? ?? ?? ?? ? ???? ?????. WeChat ?? ????? ???? ?? ?????? ???? PHP ??? ???? WeChat? ??? ? ????. ![]() WeChat ?? ?? ???? ??? ?? ??? ???? ???? ? ? ???? ??? ? ??? ?? ?? ??? ?????. ? ????? PHP? ???? WeChat ??? ?? ?? ??? ???? ??? ?????. 1. WeChat ???? openid? ?????. WeChat ??? ?? ?? ??? ???? ?? ?? ???? openid? ???? ???. WeChat ?? ??? ??? ? ??? ??? ?? openid? ?? ?? ???? ?????. ??? ??? ???? ?? ??? ?? ???? ?? ? ????. ![]() WeChat? ???? ??? ?? ? ??? ?????? ??? ???, WeChat? ??? ??? ??? ?? ??? ??? ??? ??? ?? ????. ??? ?? WeChat? ??? ????? ???? ?? ??? ??? ???? WeChat ??? ???? ?? ?? ???? ????. ? ? ?? ?? ??? ?? ?? ?????. ???? PHP ??????? ?? ??? ?? ??? ??? ???? ???? ??? ??? ?????. 1. WeChat ?? ??? ??? ?? ??? ?????. ?? ??? ?? ??? ???? ??? ?????. ![]() PHP? ???? WeChat ?? ??? ???? ?? WeChat ?? ??? ?? ??? ?? ? ?? ??? ?? ??? ??? ????, ????? ???? ? ??? PHP? ???? WeChat ?? ??? ??? ?? ????. ? ????? PHP? ???? WeChat ?? ??? ???? ???? ??? ?????. 1??: WeChat ?? ??? ??? ??? ????. WeChat ?? ?? ??? ???? ?? WeChat ?? ??? ??? ??? ???? ???. ???? ?? ??? WeChat ?? ??? ?? ????? ?????. ![]() ???? ??? ??? ??? ???? WeChat? ?? ? ??? ???? ???? ?? ??? ?????. ?? ? ?????? ??? WeChat ??? PHP? ???? ??? ?? ???? ??? ?????. ? ????? ?? WeChat ??? PHP? ???? ??? ?? ?? ?? ???? ?? ? ? ?? ??? ?????. 1. ?? ?? ?? WeChat? ???? ?? ?? ?? ?? ??? ???? ???. ??, PHP ?? ??? WeChat ?? ???? ???? ???. ![]() |