2017-11-15 3 views

답변

0

Dropbox JavaScript SDK는 메서드 호출의 반환 값이 아니라 API 호출 결과를 비동기 적으로 반환합니다.

현재 각각 thencatch를 사용하여, 결과 및 오류에 대한 콜백을 설정하는 방법의 예를 볼 수 있습니다

:

https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/basic/index.html#L54

따라서, 예를 들어, 코드가 보일 것이다을 좋아요 :

var ACCESS_TOKEN = "access_token"; 
var filePath = "/example/example.doc"; 

var dbx = new Dropbox({ accessToken: ACCESS_TOKEN }); 
dbx.sharingCreateSharedLinkWithSettings({path: filePath}) 
.then(function(response) { 
    console.log(response); 
}) 
.catch(function(error) { 
    console.log(error); 
}); 
관련 문제