How do I pass parameters to the callback function?

loginJustWithPhone: function (e) {
    //
    if (e.detail.errMsg == "getPhoneNumber:ok") {
        //
        let phone = getPhoneNum(e.detail);
        console.log(phone);
        
    } else {
        console.log("");


    }
},
function __setOpenidAndSessionKey(fun) {

wx.login({
    success: res => {
        // res.code 
        // res.code  openId, sessionKey

        wx.request({
            url: app.globalData.serverurl + "xcx/getUserSO2.action?code=" + res.code,
            success: res => {
                res = res.data;

                if (res.status == 1) {
                    let codejson = JSON.parse(res.object);
                    let openid = codejson.openid;
                    let sessionKey = codejson.session_key;

                    wx.setStorage({
                        key: "openid",
                        data: openid,
                    });

                    wx.setStorage({
                        key: "sessionKey",
                        data: sessionKey,
                    });

                    fun();
                }
            }
        });
    }
});
}



export function getPhoneNum(rawdetail) {
__setOpenidAndSessionKey(function () {
    let WXBizDataCrypt = require("../js/WXBizDataCrypt.js");

    let sessionKey = wx.getStorageSync("sessionKey");
    // console.log(rawdetail);


    //appid
    let pc = new WXBizDataCrypt(appID, sessionKey);
    // console.log(pc);



    let data = pc.decryptData(rawdetail.encryptedData, rawdetail.iv);

    return data.phoneNumber;

});




//
//
}
The rawdetail passed in

getPhoneNum () cannot be transferred into _ _ setOpenidAndSessionKey.

Mar.20,2021
The callback of

_ _ setOpenidAndSessionKey is wrapped in a function, which calls this function and passes the parameter


//rawdetail
export function getPhoneNum(rawdetail) {
    __setOpenidAndSessionKey(function (/*rawdetail*/) {
        //...
    })
}
.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36d04-3440e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36d04-3440e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?