wechat-offiaccount 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG CHANGED
@@ -11,4 +11,9 @@ v0.1.2:
11
11
  date:2023-12-31
12
12
  changes:
13
13
  - 优化改造
14
- 1、配置添加appID关联以支持多用户切换
14
+ 1、配置添加appID关联以支持多用户切换
15
+ v0.2.0:
16
+ date:2024-03-10
17
+ changes:
18
+ - 新增功能
19
+ 1、添加jweixin-1.6.0.js及相关types定义
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # [WeChat-offiaccount](https://github.com/fragement-contrib/WeChat-offiaccount)
2
- 微信公众号辅助调试服务器
2
+ 微信公众号辅助调试服务器 + 微信官方js-sdk,支持typescript开发
3
3
 
4
4
  <p>
5
5
  <a href="https://zxl20070701.github.io/toolbox/#/npm-download?packages=wechat-offiaccount&interval=7">
@@ -13,7 +13,7 @@
13
13
  </a>
14
14
  </p>
15
15
 
16
- 本项目用于搭建一个微信公众号本地测试环境,为了简单,我们基于[测试号](http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index)来说明。
16
+ 本项目用于搭建一个微信公众号本地测试环境,同时集成了微信官方js-sdk,支持typescript开发,为了简单,我们基于[测试号](http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index)来说明。
17
17
 
18
18
  > 非测试号也可以使用,填入正确字段即可,如果有问题,可以[issue](https://github.com/fragement-contrib/WeChat-offiaccount/issues)给我们留言!
19
19
 
@@ -73,6 +73,7 @@ npm run offiaccount
73
73
  接着,我们用浏览器最新的fetch举例子:
74
74
 
75
75
  ```js
76
+ import wx from "wechat-offiaccount"
76
77
  fetch("http://" + window.location.hostname + ":8080/JsApiSignature?url=" + window.location.href.split('#')[0], {
77
78
  method: "get"
78
79
  }).then(function (response) {
@@ -99,7 +100,8 @@ fetch("http://" + window.location.hostname + ":8080/JsApiSignature?url=" + windo
99
100
  上面已经配置好了,并且申请了```wx.chooseImage```权限,后续用的时候,只需要:
100
101
 
101
102
  ```js
102
- wx.ready(function () {
103
+ import wx from "wechat-offiaccount"
104
+ wx.ready(function () {
103
105
  console.log('准备好了!')
104
106
 
105
107
  // todo
package/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <title>wxConfig 测试页面</title>
8
8
  <script src="./node_modules/zdebug.js/dist/Zdebug.js"></script>
9
9
  <!-- <script src="https://unpkg.com/zdebug.js"></script> -->
10
- <script src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
10
+ <script src="./src/jweixin-1.6.0.js"></script>
11
11
  <script>
12
12
  Zdebug();
13
13
  </script>
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "wechat-offiaccount",
3
- "version": "0.1.2",
4
- "description": "微信公众号辅助调试服务器",
3
+ "version": "0.2.0",
4
+ "description": "微信公众号辅助调试服务器 + 微信官方js-sdk,支持typescript开发",
5
5
  "sideEffects": false,
6
+ "main": "src/index.js",
7
+ "typings": "./types/index.d.ts",
6
8
  "scripts": {
7
9
  "dev": "node ./bin/run --config offiaccount.config.js"
8
10
  },