function getCurrentId () {
var data;
var query = "INSERT INTO photos (path) VALUES (''); SELECT SCOPE_IDENTITY() AS id ";
var request = new mssql.Request(connection);
return new Promise(function(resolve, reject) {
request.query(query, function(err, data) {
resolve(data.recordset)
});
})
}
var main = async () =>{
var quote = await getCurrentId enter code here();
return quote; enter code here
};
我在此代码中使用异步等待但是。但此代码不正确。
var main = (async () =>{
^
SyntaxError:意外的令牌(