通过完整范围的 OAuth 成功验证后:
https://www.googleapis.com/auth/drive`
Run Code Online (Sandbox Code Playgroud)
我根据创建文件夹中的示例创建了一个文件夹
var fileMetadata = {
'name' : name,
'mimeType' : 'application/vnd.google-apps.folder',
// 'parents': [ parent ]
};
gapi.client.drive.files.create({
resource: fileMetadata,
fields: 'id'
}, function(err, file) {
if(err) {
// Handle error
console.log(err);
} else {
console.log('Folder Id: ', file.id);
return file.id;
}
});
Run Code Online (Sandbox Code Playgroud)
回调函数永远不会被调用,控制台中没有错误。
我怎样才能知道发生了什么?