11
11
<p >The URL of your canvas.</p >
12
12
<a-input v-model:value =" url" placeholder =" Url" />
13
13
<a-typography-title :level =" 3" >Access Token</a-typography-title >
14
- <p >Access Token of your canvas account. (<a href =" https://community.canvaslms.com/t5/Admin-Guide/How-do-I-manage-API-access-tokens-as-an-admin/ta-p/89" target =" _blank" >Tutorial for getting an access token</a >)</p >
14
+ <p >Access Token of your canvas account. (<a
15
+ href =" https://community.canvaslms.com/t5/Admin-Guide/How-do-I-manage-API-access-tokens-as-an-admin/ta-p/89"
16
+ target =" _blank" >Tutorial for getting an access token</a >)</p >
15
17
<a-input v-model:value =" token" placeholder =" Access Token" />
16
18
<a-typography-title :level =" 3" >Semester <a-badge count =" v 2.0" :number-style =" { backgroundColor: '#52c41a' }" />
17
19
</a-typography-title >
@@ -138,7 +140,7 @@ export default defineComponent({
138
140
}
139
141
if (change .file .status == ' removed' ) {
140
142
// Remove file
141
- const res = await del (` /file?name=${change .file .name } ` );
143
+ const res = await del (` /file?name=${change .file .name } ` , { withCredentials: true } );
142
144
if (res && res .status == 200 ) {
143
145
message .success (' Remove success' );
144
146
} else {
@@ -156,7 +158,7 @@ export default defineComponent({
156
158
message .success (' Deleted user data' );
157
159
},
158
160
async remove_attribute(key : string ) {
159
- const res = await del (` /config/key/${key } ` );
161
+ const res = await del (` /config/key/${key } ` , { withCredentials: true } );
160
162
return res && res .status == 200 ;
161
163
},
162
164
async set_attribute(key : string , value : number | string ) {
@@ -168,15 +170,15 @@ export default defineComponent({
168
170
if (typeof value === ' string' ) {
169
171
value = ' "' + value + ' "' ;
170
172
}
171
- const res = await put (` /config/key/${key } ` , value );
173
+ const res = await put (` /config/key/${key } ` , value , { withCredentials: true } );
172
174
if (! res || res .status != 200 ) {
173
175
message .error (' Failed to set attribute: ' + key );
174
176
this .has_err = true ;
175
177
}
176
178
},
177
179
async reload_files() {
178
180
this .background_filelist = [];
179
- const all_files = await get (' /file' );
181
+ const all_files = await get (' /file' , { withCredentials: true } );
180
182
if (all_files && all_files .status === 200 ) {
181
183
for (const filename of all_files .data [" files" ]) {
182
184
this .background_filelist .push ({
@@ -190,7 +192,7 @@ export default defineComponent({
190
192
},
191
193
async reload() {
192
194
// Reload configuration
193
- const res = await get (' /config' );
195
+ const res = await get (' /config' , { withCredentials: true } );
194
196
if (res && res .status === 200 ) {
195
197
// Got configuration
196
198
const conf = res .data ;
@@ -218,7 +220,7 @@ export default defineComponent({
218
220
async verify() {
219
221
// Verify the configuration
220
222
this .verify_loading = true ;
221
- const res = await get (' /config/verify' );
223
+ const res = await get (' /config/verify' , { withCredentials: true } );
222
224
if (res && res .status === 200 ) {
223
225
message .success (' Configuration verified' );
224
226
} else {
@@ -229,7 +231,7 @@ export default defineComponent({
229
231
async force_reload() {
230
232
// Force Reload
231
233
this .reload_loading = true ;
232
- const res = await get (' /config/refresh' );
234
+ const res = await get (' /config/refresh' , { withCredentials: true } );
233
235
if (res && res .status === 200 ) {
234
236
message .success (' Configuration reloaded' );
235
237
} else {
0 commit comments