@uxda/appkit 4.2.36 → 4.2.40

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
@@ -1464,10 +1464,11 @@ const vendor$2 = {
1464
1464
  }
1465
1465
  };
1466
1466
  function useHttp$2(defaultHeader) {
1467
+ console.log(defaultHeader, "defaultHeader");
1467
1468
  const appkitOptions = useAppKitOptions();
1468
1469
  const headers = {
1469
1470
  Token: appkitOptions.tempToken() || appkitOptions.token(),
1470
- Appcode: defaultHeader?.Appcode || appkitOptions.app(),
1471
+ Appcode: defaultHeader?.Appcode !== void 0 ? defaultHeader?.Appcode : appkitOptions.app(),
1471
1472
  cookie: `tid=${defaultHeader?.Tenant || appkitOptions.tenant()}`,
1472
1473
  gray: appkitOptions.gray ? appkitOptions.gray() : "0"
1473
1474
  };
@@ -1519,7 +1520,10 @@ var invokeRecharge$1 = {
1519
1520
 
1520
1521
  const requestPayment = (params) => {
1521
1522
  return new Promise((resolve, reject) => {
1522
- const $http = useHttp$2();
1523
+ const $http = useHttp$2({
1524
+ Appcode: params.app !== "cloudkitPro" ? params.app : "",
1525
+ Tenant: params.tenant
1526
+ });
1523
1527
  $http.post(endpoints.\u83B7\u53D6\u5FAE\u4FE1\u652F\u4ED8\u53C2\u6570\u5305, {
1524
1528
  ...params
1525
1529
  // amount: 0.01,
@@ -1536,7 +1540,10 @@ const requestPayment = (params) => {
1536
1540
  };
1537
1541
  const requestPaymentByBean = (params) => {
1538
1542
  return new Promise((resolve, reject) => {
1539
- const $http = useHttp$2();
1543
+ const $http = useHttp$2({
1544
+ Appcode: params.app !== "cloudkitPro" ? params.app : "",
1545
+ Tenant: params.tenant
1546
+ });
1540
1547
  $http.post(endpoints.\u83B7\u53D6\u6743\u76CA\u5FAE\u4FE1\u652F\u4ED8, {
1541
1548
  ...params
1542
1549
  }).then((response) => {
@@ -1933,9 +1940,9 @@ var script$x = /* @__PURE__ */ defineComponent({
1933
1940
  return amounts.value[state.selected] && !selectBean.value ? amounts.value[state.selected].paymentAmount : 0;
1934
1941
  });
1935
1942
  onMounted(() => {
1936
- const $http = useHttp$2();
1943
+ const $http = useHttp$2({ Appcode: props.app !== "cloudkitPro" && props.app !== "aiapprove" ? props.app : "", Tenant: props.tenant });
1937
1944
  $http.get(endpoints.\u83B7\u53D6\u589E\u503C\u6743\u76CA\u7C7B\u76EE, {
1938
- rightCode: props.app === "cloudkitPro" ? "riskQueryCompany" : "riskQueryMulti"
1945
+ rightCode: props.app === "corporateStar" ? "riskQueryCompany" : "riskQueryMulti"
1939
1946
  }).then((res) => {
1940
1947
  balance.value = res.balance;
1941
1948
  amounts.value = res.paymentCaseConfigVOS;
@@ -1943,7 +1950,7 @@ var script$x = /* @__PURE__ */ defineComponent({
1943
1950
  });
1944
1951
  const showDialog = ref(false);
1945
1952
  async function beanPay() {
1946
- const $http = useHttp$2();
1953
+ const $http = useHttp$2({ Appcode: props.app !== "cloudkitPro" && props.app !== "aiapprove" ? props.app : "", Tenant: props.tenant });
1947
1954
  $http.post(`/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`).then((response) => {
1948
1955
  if (response) {
1949
1956
  showDialog.value = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.36",
3
+ "version": "4.2.40",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -60,10 +60,11 @@ interface DefaultHeaderType {
60
60
  Tenant?: string
61
61
  }
62
62
  function useHttp(defaultHeader?: DefaultHeaderType) {
63
+ console.log(defaultHeader, 'defaultHeader')
63
64
  const appkitOptions = useAppKitOptions()
64
65
  const headers = {
65
66
  Token: appkitOptions.tempToken() || appkitOptions.token(),
66
- Appcode: defaultHeader?.Appcode || appkitOptions.app(),
67
+ Appcode: defaultHeader?.Appcode !== undefined ? defaultHeader?.Appcode : appkitOptions.app(),
67
68
  cookie: `tid=${defaultHeader?.Tenant || appkitOptions.tenant()}`,
68
69
  gray: appkitOptions.gray ? appkitOptions.gray() : '0',
69
70
  }
@@ -110,9 +110,9 @@ const currentAmount = computed(() => {
110
110
  })
111
111
 
112
112
  onMounted(() => {
113
- const $http = useHttp()
113
+ const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' && props.app !== 'aiapprove' ? props.app : '', Tenant: props.tenant })
114
114
  $http.get<any[]>(endpoints.获取增值权益类目, {
115
- rightCode: props.app === 'cloudkitPro' ? 'riskQueryCompany' : 'riskQueryMulti',
115
+ rightCode: props.app === 'corporateStar' ? 'riskQueryCompany' : 'riskQueryMulti',
116
116
  }).then((res: any) => {
117
117
  balance.value = res.balance
118
118
  amounts.value = res.paymentCaseConfigVOS
@@ -122,7 +122,7 @@ onMounted(() => {
122
122
  // 云豆支付
123
123
  const showDialog = ref<boolean>(false)
124
124
  async function beanPay() {
125
- const $http = useHttp()
125
+ const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' && props.app !== 'aiapprove' ? props.app : '', Tenant: props.tenant })
126
126
  $http.post(`/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`).then((response: any) => {
127
127
  if (response) {
128
128
  showDialog.value = false
@@ -6,54 +6,61 @@ import Taro from '@tarojs/taro'
6
6
 
7
7
  const requestPayment = (params: PaymentParams) => {
8
8
  return new Promise<boolean>((resolve, reject) => {
9
- const $http = useHttp()
10
- $http.post(endpoints.获取微信支付参数包, {
11
- ...params,
12
- // amount: 0.01,
13
- }).then(response => {
14
- weappRequestPayment(response.json).then(result => {
15
- if (result) {
16
- resolve(true)
17
- } else {
18
- resolve(false)
19
- }
20
- })
9
+ const $http = useHttp({
10
+ Appcode: params.app !== 'cloudkitPro' ? params.app : '',
11
+ Tenant: params.tenant,
21
12
  })
22
- })
23
- }
24
-
25
- const requestPaymentByBean = (params: PaymentParams) => {
26
- return new Promise<boolean>((resolve, reject) => {
27
- const $http = useHttp()
28
- $http.post(endpoints.获取权益微信支付, {
29
- ...params,
30
- }).then((response: any) => {
31
- if(!response.json){
32
- Taro.showToast({
33
- title: response.message,
34
- icon: 'none',
35
- })
36
- resolve(false)
37
- }else {
38
- weappRequestPayment(response.json).then(result => {
13
+ $http
14
+ .post(endpoints.获取微信支付参数包, {
15
+ ...params,
16
+ // amount: 0.01,
17
+ })
18
+ .then((response) => {
19
+ weappRequestPayment(response.json).then((result) => {
39
20
  if (result) {
40
21
  resolve(true)
41
22
  } else {
42
23
  resolve(false)
43
24
  }
44
25
  })
45
- }
26
+ })
27
+ })
28
+ }
29
+
30
+ const requestPaymentByBean = (params: PaymentParams) => {
31
+ return new Promise<boolean>((resolve, reject) => {
32
+ const $http = useHttp({
33
+ Appcode: params.app !== 'cloudkitPro' ? params.app : '',
34
+ Tenant: params.tenant,
46
35
  })
36
+ $http
37
+ .post(endpoints.获取权益微信支付, {
38
+ ...params,
39
+ })
40
+ .then((response: any) => {
41
+ if (!response.json) {
42
+ Taro.showToast({
43
+ title: response.message,
44
+ icon: 'none',
45
+ })
46
+ resolve(false)
47
+ } else {
48
+ weappRequestPayment(response.json).then((result) => {
49
+ if (result) {
50
+ resolve(true)
51
+ } else {
52
+ resolve(false)
53
+ }
54
+ })
55
+ }
56
+ })
47
57
  })
48
58
  }
49
59
 
50
60
  export default {
51
- install ($app: DollarApp) {
61
+ install($app: DollarApp) {
52
62
  $app.requestPayment = requestPayment
53
- }
63
+ },
54
64
  }
55
65
 
56
- export {
57
- requestPayment,
58
- requestPaymentByBean
59
- }
66
+ export { requestPayment, requestPaymentByBean }