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) {
|
function walletLogin(funId, channel) {
|
||||||
channel = parseInt(channel);
|
channel = parseInt(channel);
|
||||||
console.log('walletLogin: ' + channel)
|
console.log("walletLogin: " + channel);
|
||||||
const wallet = !window.jc || !jc.wallet
|
const wallet =
|
||||||
? new jcwallet.default({ type: 0 })
|
!window.jc || !jc.wallet ? new jcwallet.default({ type: 0 }) : jc.wallet;
|
||||||
: jc.wallet;
|
|
||||||
promiseCb(funId, wallet.preLogin(channel));
|
promiseCb(funId, wallet.preLogin(channel));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -32,9 +31,7 @@ function walletLogin(funId, channel) {
|
|||||||
function initInternalWallet(funId, chain, pass) {
|
function initInternalWallet(funId, chain, pass) {
|
||||||
chain = parseInt(chain);
|
chain = parseInt(chain);
|
||||||
const wallet =
|
const wallet =
|
||||||
!window.jc || !jc.wallet
|
!window.jc || !jc.wallet ? new jcwallet.default({ type: 0 }) : jc.wallet;
|
||||||
? new jcwallet.default({ type: 0 })
|
|
||||||
: jc.wallet;
|
|
||||||
wallet
|
wallet
|
||||||
.initInternalWallet(chain, pass)
|
.initInternalWallet(chain, pass)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -50,10 +47,8 @@ function initInternalWallet(funId, chain, pass) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 检查密码是否正确
|
* verify if password is correct
|
||||||
* @param {*} funId
|
|
||||||
* @param {*} pass
|
* @param {*} pass
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
function verifyPassword(funId, pass) {
|
function verifyPassword(funId, pass) {
|
||||||
try {
|
try {
|
||||||
@ -71,9 +66,7 @@ function verifyPassword(funId, pass) {
|
|||||||
function initThirdPartyWallet(funId, chain) {
|
function initThirdPartyWallet(funId, chain) {
|
||||||
chain = parseInt(chain);
|
chain = parseInt(chain);
|
||||||
const wallet =
|
const wallet =
|
||||||
!window.jc || !jc.wallet
|
!window.jc || !jc.wallet ? new jcwallet.default({ type: 1 }) : jc.wallet;
|
||||||
? new jcwallet.default({ type: 1 })
|
|
||||||
: jc.wallet;
|
|
||||||
wallet
|
wallet
|
||||||
.initThirdPartyWallet(chain)
|
.initThirdPartyWallet(chain)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -489,21 +482,24 @@ function emailInfo(funId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendEmailCode(funId, email, type) {
|
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) {
|
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) {
|
function checkEmailExists(funId, email) {
|
||||||
promiseCb(funId, jc.wallet.emailVerifySvr.isEmailRegister(email));
|
promiseCb(funId, jc.wallet.emailVerifySvr.isEmailRegister(email));
|
||||||
}
|
}
|
||||||
|
|
||||||
function emailRegist(funId, email, password, code) {
|
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) {
|
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