@yoooloo42/beat 1.0.23 → 1.0.25
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/package.json
CHANGED
package/src/libs/WeChat/MPC.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import Token from './Token.js'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @function getMiniProgramCode
|
|
@@ -15,7 +16,7 @@ async function getMiniProgramCode(para) {
|
|
|
15
16
|
|
|
16
17
|
// 1. 获取全局接口调用凭证 access_token (这里假设 getGlobalAccessToken 已定义)
|
|
17
18
|
// 注意:小程序和公众号共用这一个全局 access_token 接口
|
|
18
|
-
const tokenResult = await getGlobalAccessToken({ appid, secret });
|
|
19
|
+
const tokenResult = await Token.getGlobalAccessToken({ appid, secret });
|
|
19
20
|
|
|
20
21
|
if (tokenResult.code !== 0) {
|
|
21
22
|
return {
|
|
@@ -84,4 +85,6 @@ async function getMiniProgramCode(para) {
|
|
|
84
85
|
message: `网络请求失败: ${error.message}`
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export {getMiniProgramCode}
|
|
@@ -5,7 +5,7 @@ import random from '@yoooloo42/bean/utils/random'
|
|
|
5
5
|
import RSA from '../crypto/RSA.js'
|
|
6
6
|
import v3sign from "./v3sign.js"
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function v3jsapi(para){
|
|
9
9
|
// para.appid 微信开放平台或微信公众平台应用id(APPID)
|
|
10
10
|
// para.mchid 商户号
|
|
11
11
|
// para.serial_no 证书序列号
|
|
@@ -68,5 +68,5 @@ function v3getPrepayId(para){
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
v3jsapi
|
|
72
72
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// 获取code_url
|
|
3
3
|
|
|
4
4
|
import v3sign from "./v3sign.js"
|
|
5
|
-
function
|
|
5
|
+
function v3native(para){
|
|
6
6
|
// para.appid 微信开放平台或微信公众平台应用id(APPID)
|
|
7
7
|
// para.mchid 商户号
|
|
8
8
|
// para.serial_no 证书序列号
|
|
@@ -43,5 +43,5 @@ function v3getCodeUrl(para){
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
v3native
|
|
47
47
|
}
|