# xiaochengxuGen
微信小程序页面生成器等工具类
--------------------------------------------------
使用方法:
- GeneratorUtil.generateModule("模块名字");
将同时生成模块文件夹,js,wxss,wxml文件
以下是生成tool模块的结果示例
/**
* GeneratorUtil.generateModule("tool");
* result as below
* 生成 F:\pro\hyc2016\pages\tool\tool.js 完成
* 生成 F:\pro\hyc2016\pages\tool\tool.wxss 完成
* 生成 F:\pro\hyc2016\pages\tool\tool.wxml 完成
*
*/
## aesUtil 解密数据
接口如果涉及敏感数据(如wx.getUserInfo当中的 openId 和unionId ),接口的明文内容将不包含这些敏感数据。开发者如需要获取敏感数据,需要对接口返回的加密数据( encryptedData )进行对称解密。 解密算法如下:
对称解密使用的算法为 AES-128-CBC,数据采用PKCS#7填充。
对称解密的目标密文为 Base64_Decode(encryptedData),
对称解密秘钥 aeskey = Base64_Decode(session_key), aeskey 是16字节
对称解密算法初始向量 iv 会在数据接口中返回。
onLoad: function () {
wx.login({
success: function (res) {
console.log(res);
wx.getUserInfo({
success: function (ddd) {
console.log(ddd);
}
});
if (res.code) {
//发起网络请求
...
/**
* 代码中的测试数据和微信小程序官方提供的一致
* @param args
*/
public static void main(String[] args) {
String appid = "wx4f4bc4dec97d474b";
String sessionKey = "tiihtNczf5v6AKRyjwEUhQ==";
AesUtil util = new AesUtil(appid, sessionKey);
String encryptedData=Ftl2String.createHtmlString("enc",null);
// System.out.println(encryptedData);
String iv = "r7BXXKkLb8qrSNn05n0qiA==";
util.decryptData(encryptedData, iv);
/**
* {"openId":"oGZUI0egBJY1zhBYw2KhdUfwVJJE","nickName":"Band","gender":1,"language":"zh_CN",
* "city":"Guangzhou","province":"Guangdong","country":"CN",
* "avatarUrl":"http://wx.qlogo.cn/mmopen/vi_32/aSKcBBPpibyKNicHNTMM0qJVh8Kjgiak2AHWr8MHM4WgMEm7GFhsf8OYrySdbvAMvTsw3mo8ibKicsnfN5pRjl1p8HQ/0",
* "unionId":"ocMvos6NjeKLIBqg5Mr9QjxrP1FA","watermark":{"timestamp":1477314187,"appid":"wx4f4bc4dec97d474b"}}
*
*/
}
没有合适的资源?快使用搜索试试~ 我知道了~
小程序源码(无后台)_小程序页面生成器.rar
共31个文件
java:6个
js:5个
wxss:4个
需积分: 5 0 下载量 161 浏览量
2023-06-12
08:21:21
上传
评论
收藏 3.64MB RAR 举报
温馨提示
版权声明: 本资源仅供学习参考,不得进行任何商业用途!
资源推荐
资源详情
资源评论
收起资源包目录
小程序源码(无后台)_小程序页面生成器.rar (31个子文件)
小程序页面生成器
xiaochengxuGen-master
lib
commons-codec-1.8.jar 258KB
bcprov-jdk15on-155.jar 3.24MB
freemarker-2.3.9.jar 789KB
.classpath 493B
.settings
org.eclipse.core.resources.prefs 90B
src
template
index.wxml 147B
index.js 202B
enc 548B
enc2 568B
index.wxss 96B
com
xiaochengxu
aes
AesException.java 2KB
AesUtil.java 2KB
SHA1.java 2KB
PKCS7Encoder.java 2KB
generator
heyunchou
Ftl2String.java 2KB
GeneratorUtil.java 3KB
LICENSE 11KB
demo
pages
index
index.wxml 437B
index.js 563B
index.wxss 327B
logs
logs.json 62B
logs.js 280B
logs.wxml 179B
logs.wxss 114B
app.json 253B
app.js 748B
utils
util.js 481B
app.wxss 204B
.project 390B
.gitignore 126B
README.md 2KB
共 31 条
- 1
资源评论
2301_78600126
- 粉丝: 1
- 资源: 686
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功