let apiUrl = this.serverAdress + '/api2/auth-token/';
const data = {
'username': this.username,
'password': this.password
};
let header = {
'Content-Type': 'application/json',
'X-SEAFILE-OTP': totp
};
const response = await fetch(new Request(apiUrl, {
method: 'POST',
headers: new Headers(header),
body: JSON.stringify(data),
}));
return response;
我收到来自 API 的响应,如下所示,我想将结果解析为 JSON。
当我尝试使用访问令牌时,await response.json()["token"]我返回未定义。
一只萌萌小番薯
狐的传说
慕标琳琳
随时随地看视频慕课网APP
相关分类