0
獲得活動的用戶電子郵件如果用戶沒有在開發過程中遇到問題授權訪問「Drive」時,系統無法通過「Session.getActiveUser().getEmail()」返回當前用戶的電子郵件地址,當用戶訪問Google網站時,系統返回空值。 但是一個月前,我可以在我的Google應用程序中通過「Session.getActiveUser()。getEmail()」獲取用戶的電子郵件地址,現在不能。爲什麼?如果用戶沒有Google Drive權限,則Google Apps腳本無法使用「Session.getActiveUser()。getEmail()」
了谷歌網站樣品編碼:
function doGet(e) {
var app = UiApp.createApplication();
var La = app.createLabel();
app.add(La.setText(Session.getActiveUser().getEmail()));
return app;
}