|
@@ -30,17 +30,19 @@ const onFirstMount = async() => {
|
|
|
const pageElement = page.pageEl;
|
|
const pageElement = page.pageEl;
|
|
|
const imageDiv = pageElement.querySelector('.auth-image') as HTMLDivElement;
|
|
const imageDiv = pageElement.querySelector('.auth-image') as HTMLDivElement;
|
|
|
|
|
|
|
|
- let preloader = putPreloader(imageDiv, true);
|
|
|
|
|
|
|
+ // let preloader = putPreloader(imageDiv, true);
|
|
|
|
|
|
|
|
const inputWrapper = document.createElement('div');
|
|
const inputWrapper = document.createElement('div');
|
|
|
inputWrapper.classList.add('input-wrapper');
|
|
inputWrapper.classList.add('input-wrapper');
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
const btnBack = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'Login.QR.Cancel'});
|
|
const btnBack = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'Login.QR.Cancel'});
|
|
|
inputWrapper.append(btnBack);
|
|
inputWrapper.append(btnBack);
|
|
|
|
|
|
|
|
if(getCurrentAccount() === 1) {
|
|
if(getCurrentAccount() === 1) {
|
|
|
getLanguageChangeButton(inputWrapper);
|
|
getLanguageChangeButton(inputWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
// 添加Web Token登录选项
|
|
// 添加Web Token登录选项
|
|
|
const webTokenWrapper = document.createElement('div');
|
|
const webTokenWrapper = document.createElement('div');
|
|
@@ -62,7 +64,7 @@ const onFirstMount = async() => {
|
|
|
|
|
|
|
|
const tokenInput = document.createElement('textarea');
|
|
const tokenInput = document.createElement('textarea');
|
|
|
tokenInput.classList.add('input-field');
|
|
tokenInput.classList.add('input-field');
|
|
|
- tokenInput.placeholder = 'url';
|
|
|
|
|
|
|
+ tokenInput.placeholder = '';
|
|
|
tokenInput.style.width = '100%';
|
|
tokenInput.style.width = '100%';
|
|
|
tokenInput.style.padding = '12px';
|
|
tokenInput.style.padding = '12px';
|
|
|
tokenInput.style.borderRadius = '8px';
|
|
tokenInput.style.borderRadius = '8px';
|
|
@@ -246,6 +248,7 @@ const onFirstMount = async() => {
|
|
|
|
|
|
|
|
const container = imageDiv.parentElement;
|
|
const container = imageDiv.parentElement;
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
const h4 = document.createElement('h4');
|
|
const h4 = document.createElement('h4');
|
|
|
_i18n(h4, 'Login.QR.Title');
|
|
_i18n(h4, 'Login.QR.Title');
|
|
|
|
|
|
|
@@ -258,9 +261,12 @@ const onFirstMount = async() => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
container.append(h4, helpList, inputWrapper);
|
|
container.append(h4, helpList, inputWrapper);
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
// 添加Web Token部分到QR页面
|
|
// 添加Web Token部分到QR页面
|
|
|
container.append(webTokenWrapper);
|
|
container.append(webTokenWrapper);
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
btnBack.addEventListener('click', () => {
|
|
btnBack.addEventListener('click', () => {
|
|
|
import('./pageSignIn').then((m) => m.default.mount());
|
|
import('./pageSignIn').then((m) => m.default.mount());
|
|
|
stop = true;
|
|
stop = true;
|
|
@@ -270,6 +276,7 @@ const onFirstMount = async() => {
|
|
|
import('qr-code-styling' as any)
|
|
import('qr-code-styling' as any)
|
|
|
]);
|
|
]);
|
|
|
const QRCodeStyling = results[0].default;
|
|
const QRCodeStyling = results[0].default;
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
let stop = false;
|
|
let stop = false;
|
|
|
rootScope.addEventListener('user_auth', (auth) => {
|
|
rootScope.addEventListener('user_auth', (auth) => {
|
|
@@ -277,6 +284,7 @@ const onFirstMount = async() => {
|
|
|
cachedPromise = null;
|
|
cachedPromise = null;
|
|
|
}, {once: true});
|
|
}, {once: true});
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
const options: {dcId?: DcId, ignoreErrors: true} = {ignoreErrors: true};
|
|
const options: {dcId?: DcId, ignoreErrors: true} = {ignoreErrors: true};
|
|
|
let prevToken: Uint8Array | number[];
|
|
let prevToken: Uint8Array | number[];
|
|
|
|
|
|
|
@@ -313,6 +321,7 @@ const onFirstMount = async() => {
|
|
|
var decoder = new TextDecoder('utf8');
|
|
var decoder = new TextDecoder('utf8');
|
|
|
var b64encoded = btoa(String.fromCharCode.apply(null, [...loginToken.token])); */
|
|
var b64encoded = btoa(String.fromCharCode.apply(null, [...loginToken.token])); */
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
if(!prevToken || !bytesCmp(prevToken, loginToken.token)) {
|
|
if(!prevToken || !bytesCmp(prevToken, loginToken.token)) {
|
|
|
prevToken = loginToken.token;
|
|
prevToken = loginToken.token;
|
|
|
|
|
|
|
@@ -420,10 +429,12 @@ const onFirstMount = async() => {
|
|
|
|
|
|
|
|
return false;
|
|
return false;
|
|
|
};
|
|
};
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
return async() => {
|
|
return async() => {
|
|
|
stop = false;
|
|
stop = false;
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
do {
|
|
do {
|
|
|
if(stop) {
|
|
if(stop) {
|
|
|
break;
|
|
break;
|
|
@@ -434,6 +445,7 @@ const onFirstMount = async() => {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
} while(true);
|
|
} while(true);
|
|
|
|
|
+ */
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|