首页 文章 精选 留言 我的

精选列表

搜索[统一认证平台],共10006篇文章
优秀的个人博客,低调大师

微信开发之token认证

服务器配置如下 package com.dongpeng; import java.security.MessageDigest; import java.util.Arrays; import javax.servlet.http.HttpServletResponse; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller @SpringBootApplication public class Application { public static final String TOKEN = "lianghao_token"; @RequestMapping("/") @ResponseBody public void index(String signature, String timestamp, String nonce, String echostr,HttpServletResponse response)throws Exception { System.out.println("signature:" + signature); System.out.println("timestamp:" + timestamp); System.out.println("nonce:" + nonce); System.out.println("echostr:" + echostr); System.out.println("TOKEN:" + TOKEN); String[] params = new String[] { TOKEN, timestamp, nonce }; Arrays.sort(params); // 将三个参数字符串拼接成一个字符串进行sha1加密 String clearText = params[0] + params[1] + params[2]; String algorithm = "SHA-1"; String sign = new String(org.apache.commons.codec.binary.Hex .encodeHex(MessageDigest.getInstance(algorithm).digest((clearText).getBytes()), true)); // 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信 if (signature.equals(sign)) { response.getWriter().print(echostr); } } public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } } 配置服务端后,提交下面信息 才能成功提交

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册