reformat main.js
This commit is contained in:
parent
9a21184d36
commit
72e8e91151
@ -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));
|
||||
}
|
||||
promiseCb(funId, jc.wallet.emailLogin(email, password));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user