我正在尝试将数据从旧表复制到下面在MYSQL中列出的新表中
test.adminpasswordreset
(正在插入的表)
TOKEN(VARCHAR) ADMINID(INT) TIMEIN ISUSED
在重置密码时需要从ID
表中提取user
中的adminid
test.userprofile
ID(INT) USERNAME(VARCHAR)
从userprofile
答案 0 :(得分:0)
function delay(input) {
return new Promise(function(resolve, reject) {
// some async operation here
setTimeout(function() {
// resolve the promise with some value
resolve(input + 10);
}, 500);
});
}
**async** function testing() { // Declare this an asynchronous function
let value = **await** delay(5); // Now you can await the resolution of the Promise
console.log(value); // Outputs resolved value 15!
return value; // Just returns resolved Promise
}
var test = testing();
console.log(test);
/** Outputs the Promise!
Promise {<pending>}
__proto__:Promise
[[PromiseStatus]]:"resolved"
[[PromiseValue]]:15
*/
test.then(console.log)); // Outputs returned resolved value, 15