reformat main.js

This commit is contained in:
zhl 2023-05-12 17:39:46 +08:00
parent 9a21184d36
commit 72e8e91151

View File

@ -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(() => {
@ -501,7 +494,10 @@ function checkEmailExists(funId, 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) {