@uxda/appkit 1.0.22 → 1.0.24

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/dist/index.js CHANGED
@@ -218,6 +218,7 @@ let clientConfig = {
218
218
  const request = (config) => {
219
219
  return new Promise((resolve, reject) => {
220
220
  const data = config.data && clientConfig.translates && clientConfig.translates[config.url] ? clientConfig.translates[config.url](config.data) : config.data;
221
+ console.log(`[][][][][][][][][][][][] HTTP.${config.method}, ${clientConfig.baseUrl}${config.url}`, data);
221
222
  Taro.request({
222
223
  url: `${clientConfig.baseUrl}${config.url}`,
223
224
  data,
@@ -1676,6 +1677,10 @@ const services = [
1676
1677
  ...services$1
1677
1678
  ];
1678
1679
  const $app = {
1680
+ setToken: (token) => {
1681
+ const appKitOptions = useAppKitOptions();
1682
+ appKitOptions.token = token;
1683
+ },
1679
1684
  requestPayment: (options) => {
1680
1685
  },
1681
1686
  invokeRecharge: (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
package/src/Appkit.ts CHANGED
@@ -17,6 +17,7 @@ export type AppKitOptions = {
17
17
  }
18
18
 
19
19
  export type DollarApp = {
20
+ setToken: (token: () => string) => void,
20
21
  requestPayment: (options: PaymentParams) => void,
21
22
  invokeRecharge: (options: RechargeParams) => void,
22
23
  }
@@ -36,6 +37,8 @@ const useAppKitOptions = () => {
36
37
  return globalData.$appKitOptions as AppKitOptions
37
38
  }
38
39
 
40
+
41
+
39
42
  export {
40
43
  useAppKitOptions,
41
44
  }
package/src/index.ts CHANGED
@@ -36,6 +36,10 @@ const services = [
36
36
  ]
37
37
 
38
38
  const $app: DollarApp = {
39
+ setToken: (token: () => string) => {
40
+ const appKitOptions = useAppKitOptions()
41
+ appKitOptions.token = token
42
+ },
39
43
  requestPayment: (options: PaymentParams) => {},
40
44
  invokeRecharge: (options: RechargeParams) => {}
41
45
  }
@@ -43,6 +43,7 @@ const request: Http['request'] = <T>(config: HttpRequestConfig) => {
43
43
  && clientConfig.translates[config.url]
44
44
  ? clientConfig.translates[config.url](config.data)
45
45
  : config.data
46
+ console.log(`[][][][][][][][][][][][] HTTP.${config.method}, ${clientConfig.baseUrl}${config.url}`, data)
46
47
  Taro.request<ResponseData>({
47
48
  url: `${clientConfig.baseUrl}${config.url}`,
48
49
  data,