質問編集履歴
5
試したことの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -156,6 +156,19 @@
|
|
156
156
|
|
157
157
|
```
|
158
158
|
|
159
|
+
GASでのスコープ設定
|
160
|
+
```json
|
161
|
+
"oauthScopes": [
|
162
|
+
"https://www.googleapis.com/auth/script.external_request",
|
163
|
+
"https://www.googleapis.com/auth/userinfo.email",
|
164
|
+
"https://www.googleapis.com/auth/drive.file",
|
165
|
+
"https://www.googleapis.com/auth/drive",
|
166
|
+
"https://www.googleapis.com/auth/drive.apps.readonly",
|
167
|
+
"https://www.googleapis.com/auth/drive.readonly",
|
168
|
+
"https://www.googleapis.com/auth/drive.appfolder",
|
169
|
+
"https://www.googleapis.com/auth/drive.scripts"
|
170
|
+
]
|
171
|
+
```
|
159
172
|
|
160
173
|
```html
|
161
174
|
<!DOCTYPE html>
|
4
実施したことを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -140,3 +140,68 @@
|
|
140
140
|
|:--|:--|:--|
|
141
141
|
||||
|
142
142
|
|
143
|
+
---
|
144
|
+
ScriptApp.getOAuthToken() で値を取得し
|
145
|
+
HTMLファイルに反映させましたが、結果は変わらずでした。
|
146
|
+
|
147
|
+
ScriptApp.getOAuthToken()の値を取得し、設定した方法
|
148
|
+
1. ダミー関数をGASのエディタから実行して、コンソールに表示された値をコピー
|
149
|
+
2. 1 でコピーした値をHTMLファイルの oAuthToken の値にセット
|
150
|
+
|
151
|
+
```gs
|
152
|
+
// ダミー関数
|
153
|
+
function myFunction() {
|
154
|
+
console.log(ScriptApp.getOAuthToken())
|
155
|
+
}
|
156
|
+
|
157
|
+
```
|
158
|
+
|
159
|
+
|
160
|
+
```html
|
161
|
+
<!DOCTYPE html>
|
162
|
+
<html>
|
163
|
+
<head>
|
164
|
+
<meta charset="utf-8" />
|
165
|
+
</head>
|
166
|
+
<body>
|
167
|
+
</body>
|
168
|
+
<script>
|
169
|
+
let url = 'https://script.google.com/macros/s/***/exec';
|
170
|
+
|
171
|
+
let oAuthToken = 'ya29.A0ARrdaM-b4Qkdt970ib90xUfoXIsCqkJYZWyg1KnJw04kIBlFvSZ1QwaP-u_ed5BbIamgpT6p-MWqYPoY5RtMWvXXt06DqmeIE6C2cromOec2WSlY4wQanAvAhLpoGAoZKf80377UACfIuoAGLqV8ks8X-MVpnKn5DO7icpB6KxSfhDI';
|
172
|
+
|
173
|
+
let option = {
|
174
|
+
'mode': 'no-cors'
|
175
|
+
, 'method': 'GET'
|
176
|
+
, 'Content-Type': 'text/plain'
|
177
|
+
, 'headers': {
|
178
|
+
"Authorization": "Bearer " + oAuthToken
|
179
|
+
}
|
180
|
+
};
|
181
|
+
|
182
|
+
let text = '';
|
183
|
+
fetch(url, option)
|
184
|
+
.then(
|
185
|
+
function(res) {
|
186
|
+
console.log(res);
|
187
|
+
return res.text();
|
188
|
+
}
|
189
|
+
).then(
|
190
|
+
function(json) {
|
191
|
+
text = json;
|
192
|
+
console.log("戻り値:" + json);
|
193
|
+
}
|
194
|
+
).catch(function(exception) {
|
195
|
+
console.log(exception);
|
196
|
+
});
|
197
|
+
</script>
|
198
|
+
</html>
|
199
|
+
```
|
200
|
+
|
201
|
+
[![画像の説明をここに入力][1]][1]
|
202
|
+
|
203
|
+
|
204
|
+
[1]: https://i.stack.imgur.com/Mr0F6.png
|
205
|
+
|
206
|
+
|
207
|
+
|
3
画像の列名を変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
|
138
138
|
### 画像
|
139
|
-
|
|
139
|
+
|credentials: 'include'|credentials: 'same-origin'|credentials: 'omit'|
|
140
140
|
|:--|:--|:--|
|
141
141
|
||||
|
142
142
|
|
2
画像の表示方法を変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
|
138
138
|
### 画像
|
139
|
-
|
140
|
-
|
141
|
-

|
139
|
+
|列1|列2|列3|
|
140
|
+
|:--|:--|:--|
|
141
|
+
||||
|
142
142
|
|
1
画像の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -135,4 +135,8 @@
|
|
135
135
|
なのでこの設定は避けたいです。
|
136
136
|
|
137
137
|
|
138
|
+
### 画像
|
139
|
+

|
140
|
+

|
141
|
+

|
138
142
|
|