@uxda/appkit 1.2.46 → 1.2.50

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
@@ -3,6 +3,7 @@ import Taro, { useDidShow } from '@tarojs/taro';
3
3
  import '@nutui/nutui-taro';
4
4
  import dayjs from 'dayjs';
5
5
  import groupBy from 'lodash/groupBy';
6
+ import debounce from 'lodash/debounce';
6
7
 
7
8
  const _hoisted_1$n = { class: "token-line number" };
8
9
  const _hoisted_2$j = { class: "number" };
@@ -3487,7 +3488,7 @@ function useHttp() {
3487
3488
  return false;
3488
3489
  },
3489
3490
  (raw) => {
3490
- if (raw.status > 500 && raw.status != 51014) {
3491
+ if (raw.status > 500 && raw.status != 51015 && raw.status != 51014) {
3491
3492
  return true;
3492
3493
  }
3493
3494
  return false;
@@ -3808,10 +3809,13 @@ var script = /* @__PURE__ */ defineComponent({
3808
3809
  }
3809
3810
  return str;
3810
3811
  });
3812
+ onMounted(() => {
3813
+ checkLoginTimeRule();
3814
+ });
3811
3815
  useDidShow(() => {
3812
3816
  checkLoginTimeRule();
3813
3817
  });
3814
- async function checkLoginTimeRule() {
3818
+ const checkLoginTimeRule = debounce(() => {
3815
3819
  const appkitOptions = useAppKitOptions();
3816
3820
  const $http = useHttp();
3817
3821
  $http.post("/cas/sysUser/checkLoginTimeRule", {
@@ -3819,13 +3823,17 @@ var script = /* @__PURE__ */ defineComponent({
3819
3823
  tenantId: appkitOptions.tenant(),
3820
3824
  device: "mini"
3821
3825
  }).then((result) => {
3822
- if (result === true)
3826
+ if (result === true) {
3827
+ showLoginRule.value = false;
3828
+ loginRuleTip.value = "";
3829
+ emits("show", loginRuleTip.value);
3823
3830
  return;
3824
- loginRuleTip.value = result.message;
3831
+ }
3825
3832
  showLoginRule.value = true;
3833
+ loginRuleTip.value = result.message;
3826
3834
  emits("show", loginRuleTip.value);
3827
3835
  });
3828
- }
3836
+ }, 100);
3829
3837
  const emits = __emit;
3830
3838
  return (_ctx, _cache) => {
3831
3839
  return _ctx.show && showLoginRule.value ? (openBlock(), createElementBlock(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.2.46",
3
+ "version": "1.2.50",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -54,7 +54,7 @@ function useHttp() {
54
54
  return false
55
55
  },
56
56
  (raw) => {
57
- if (raw.status > 500 && raw.status != 51014) {
57
+ if (raw.status > 500 && raw.status != 51015 && raw.status != 51014) {
58
58
  return true
59
59
  }
60
60
  return false
@@ -11,11 +11,12 @@
11
11
  </template>
12
12
 
13
13
  <script lang="ts" setup>
14
- import { computed, ref } from 'vue'
14
+ import { computed, ref, onMounted } from 'vue'
15
15
  import { useHttp } from '../api'
16
16
  import { useAppKitOptions } from '../../Appkit'
17
17
  import { useSafeArea } from '../../shared/composables'
18
18
  import { useDidShow } from '@tarojs/taro'
19
+ import debounce from 'lodash/debounce'
19
20
 
20
21
  const props = withDefaults(
21
22
  defineProps<{
@@ -47,12 +48,15 @@ const style = computed(() => {
47
48
  return str
48
49
  })
49
50
 
51
+ onMounted(() => {
52
+ checkLoginTimeRule()
53
+ })
50
54
  useDidShow(() => {
51
55
  checkLoginTimeRule()
52
56
  })
53
57
 
54
58
  // 检验登录时间
55
- async function checkLoginTimeRule() {
59
+ const checkLoginTimeRule = debounce(() => {
56
60
  const appkitOptions = useAppKitOptions()
57
61
 
58
62
  const $http = useHttp()
@@ -63,15 +67,18 @@ async function checkLoginTimeRule() {
63
67
  device: 'mini',
64
68
  })
65
69
  .then((result: any) => {
66
- if (result === true) return
67
-
68
- loginRuleTip.value = result.message
70
+ if (result === true) {
71
+ showLoginRule.value = false
72
+ loginRuleTip.value = ''
73
+ emits('show', loginRuleTip.value)
74
+ return
75
+ }
69
76
 
70
77
  showLoginRule.value = true
71
-
78
+ loginRuleTip.value = result.message
72
79
  emits('show', loginRuleTip.value)
73
80
  })
74
- }
81
+ }, 100)
75
82
 
76
83
  // 父组件事件
77
84
  const emits = defineEmits(['show'])