fix: login에서 modal을 Bootstrap5 Modal로
This commit is contained in:
+10
-4
@@ -8,7 +8,7 @@ import { sha512 } from 'js-sha512';
|
|||||||
import { unwrap } from '@util/unwrap';
|
import { unwrap } from '@util/unwrap';
|
||||||
import { InvalidResponse } from '@/defs';
|
import { InvalidResponse } from '@/defs';
|
||||||
import { delay } from '@util/delay';
|
import { delay } from '@util/delay';
|
||||||
import 'bootstrap';
|
import { Modal } from 'bootstrap';
|
||||||
import '@/gateway/common';
|
import '@/gateway/common';
|
||||||
|
|
||||||
import '@scss/gateway/login.scss';
|
import '@scss/gateway/login.scss';
|
||||||
@@ -54,6 +54,8 @@ declare global {
|
|||||||
declare const kakao_oauth_client_id: string;
|
declare const kakao_oauth_client_id: string;
|
||||||
declare const kakao_oauth_redirect_uri: string;
|
declare const kakao_oauth_redirect_uri: string;
|
||||||
|
|
||||||
|
let modalOTP: Modal|undefined = undefined;
|
||||||
|
|
||||||
let oauthMode: string | null = null;
|
let oauthMode: string | null = null;
|
||||||
|
|
||||||
const TOKEN_VERSION = 1;
|
const TOKEN_VERSION = 1;
|
||||||
@@ -228,10 +230,12 @@ async function doLoginUsingOAuth() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const $modal = $('#modalOTP').modal() as unknown as JQuery;
|
const modalEl = unwrap(document.querySelector('#modalOTP'))
|
||||||
$modal.on('shown.bs.modal', function () {
|
modalOTP = new Modal(modalEl);
|
||||||
|
modalEl.addEventListener('shown.bs.modal', function(){
|
||||||
$('#otp_code').trigger('focus');
|
$('#otp_code').trigger('focus');
|
||||||
});
|
});
|
||||||
|
modalOTP.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function postOAuthResult(mode: string) {
|
function postOAuthResult(mode: string) {
|
||||||
@@ -375,7 +379,9 @@ $(async function ($) {
|
|||||||
alert(result.reason);
|
alert(result.reason);
|
||||||
|
|
||||||
if (result.reset) {
|
if (result.reset) {
|
||||||
$('#modalOTP').modal('hide')
|
if(modalOTP){
|
||||||
|
modalOTP.hide();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -19,6 +19,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/bootstrap": "^5.1.6",
|
||||||
"@types/downloadjs": "^1.4.2",
|
"@types/downloadjs": "^1.4.2",
|
||||||
"@types/linkifyjs": "^2.1.4",
|
"@types/linkifyjs": "^2.1.4",
|
||||||
"@types/select2": "^4.0.54",
|
"@types/select2": "^4.0.54",
|
||||||
@@ -49,7 +50,6 @@
|
|||||||
"@babel/preset-env": "^7.16.4",
|
"@babel/preset-env": "^7.16.4",
|
||||||
"@babel/preset-typescript": "^7.16.0",
|
"@babel/preset-typescript": "^7.16.0",
|
||||||
"@coreui/vue": "^4.1.1",
|
"@coreui/vue": "^4.1.1",
|
||||||
"@types/bootstrap": "^5.1.6",
|
|
||||||
"@types/jquery": "^3.5.10",
|
"@types/jquery": "^3.5.10",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.178",
|
||||||
"@types/node": "^16.11.12",
|
"@types/node": "^16.11.12",
|
||||||
|
|||||||
Reference in New Issue
Block a user