File tree 2 files changed +17
-22
lines changed
2 files changed +17
-22
lines changed Original file line number Diff line number Diff line change 1
1
export const REDIRECT_ROUTE_NAME = 'Redirect' ;
2
2
3
- export const DEFAULT_ROUTE_NAME = 'dashboard ' ;
3
+ export const DEFAULT_ROUTE_NAME = 'Dashboard ' ;
4
4
5
5
export const NOT_FOUND_ROUTE_NAME = 'notFound' ;
6
6
Original file line number Diff line number Diff line change @@ -47,14 +47,19 @@ const props = defineProps({
47
47
48
48
const visible = ref (false );
49
49
const captcha = ref (null );
50
+ let resolveCallback = null ;
50
51
51
52
const show = async () => {
52
- try {
53
- captcha .value = await useHttpGet (" /api/captcha/request_angle" );
54
- visible .value = true ;
55
- } catch (error) {
56
- console .error (error);
57
- }
53
+ return new Promise (async (resolve ) => {
54
+ try {
55
+ captcha .value = await useHttpGet (" /api/captcha/request_angle" );
56
+ visible .value = true ;
57
+ resolveCallback = resolve;
58
+ } catch (e) {
59
+ console .error (e);
60
+ useCatchError (e);
61
+ }
62
+ });
58
63
};
59
64
60
65
const captchaRefresh = async () => {
@@ -70,23 +75,13 @@ const captchaClose = () => {
70
75
};
71
76
72
77
const captchaConfirm = (angle , reset ) => {
73
- emits (
74
- " confirm" ,
75
- // 参数1:验证码信息
76
- {
78
+ if (resolveCallback) {
79
+ resolveCallback ({
77
80
captchaId: captcha .value .id ,
78
81
captchaCode: angle,
79
- },
80
- // 参数2:回调
81
- (success ) => {
82
- captchaClose ();
83
- // if (success) {
84
- // captchaClose();
85
- // } else {
86
- // captchaRefresh();
87
- // }
88
- }
89
- );
82
+ });
83
+ }
84
+ captchaClose ();
90
85
};
91
86
92
87
defineExpose ({
You can’t perform that action at this time.
0 commit comments