From 72e8e91151021319f2fffacb16f0c95762da8192 Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 12 May 2023 17:39:46 +0800 Subject: [PATCH] reformat main.js --- Data/js/main.js | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Data/js/main.js b/Data/js/main.js index 804c724..cd34c6b 100644 --- a/Data/js/main.js +++ b/Data/js/main.js @@ -17,10 +17,9 @@ function promiseCb(funId, promiseFun, dataParser) { */ function walletLogin(funId, channel) { channel = parseInt(channel); - console.log('walletLogin: ' + channel) - const wallet = !window.jc || !jc.wallet - ? new jcwallet.default({ type: 0 }) - : jc.wallet; + console.log("walletLogin: " + channel); + const wallet = + !window.jc || !jc.wallet ? new jcwallet.default({ type: 0 }) : jc.wallet; promiseCb(funId, wallet.preLogin(channel)); } /** @@ -32,9 +31,7 @@ function walletLogin(funId, channel) { function initInternalWallet(funId, chain, pass) { chain = parseInt(chain); const wallet = - !window.jc || !jc.wallet - ? new jcwallet.default({ type: 0 }) - : jc.wallet; + !window.jc || !jc.wallet ? new jcwallet.default({ type: 0 }) : jc.wallet; wallet .initInternalWallet(chain, pass) .then(() => { @@ -50,10 +47,8 @@ function initInternalWallet(funId, chain, pass) { }); } /** - * 检查密码是否正确 - * @param {*} funId + * verify if password is correct * @param {*} pass - * @returns */ function verifyPassword(funId, pass) { try { @@ -71,9 +66,7 @@ function verifyPassword(funId, pass) { function initThirdPartyWallet(funId, chain) { chain = parseInt(chain); const wallet = - !window.jc || !jc.wallet - ? new jcwallet.default({ type: 1 }) - : jc.wallet; + !window.jc || !jc.wallet ? new jcwallet.default({ type: 1 }) : jc.wallet; wallet .initThirdPartyWallet(chain) .then(() => { @@ -489,21 +482,24 @@ function emailInfo(funId) { } function sendEmailCode(funId, email, type) { - promiseCb(funId, jc.wallet.emailVerifySvr.sendEmailCode(email, type)); + promiseCb(funId, jc.wallet.emailVerifySvr.sendEmailCode(email, type)); } function verifyEmail(funId, email, code) { - promiseCb(funId, jc.wallet.emailVerifySvr.updateEmailVerify(email, code)); + promiseCb(funId, jc.wallet.emailVerifySvr.updateEmailVerify(email, code)); } function checkEmailExists(funId, email) { - promiseCb(funId, jc.wallet.emailVerifySvr.isEmailRegister(email)); + promiseCb(funId, jc.wallet.emailVerifySvr.isEmailRegister(email)); } function emailRegist(funId, email, password, code) { - promiseCb(funId, jc.wallet.emailVerifySvr.registByEmail(email, password, code)); + promiseCb( + funId, + jc.wallet.emailVerifySvr.registByEmail(email, password, code) + ); } function emailLogin(funId, email, password) { - promiseCb(funId, jc.wallet.emailLogin(email, password)); -} \ No newline at end of file + promiseCb(funId, jc.wallet.emailLogin(email, password)); +}