How can I get the value outside the success after Mini Program requests the API?

the code is shown below:

clipboard.png

:

clipboard.png

clipboard.png

clipboard.png

question:
1, the position t.data.memberInfo of print 1 can get the value;
2, the position t.data of print 2 exists memberInfo;
3, and the position t.data.memberInfo of print 3 is undefined. What is the reason? What should we do about it?


function caozuo(data){
    //
    console.log(data);
}

success: function(res){
    caozuo(res);
}

suggest that the landlord take a look at asynchronous processing


callback "Promise" async/await

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-1bb4c93-2ff15.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-1bb4c93-2ff15.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?