AcaMate_Web/wwwroot/scripts/apiSender.js
Seonkyu.kim c178a17c04 [] 회원가입 기능
1. sns 로그인 작업 후 회원 없는 경우 회원가입 로직으로 전환
2. 디자인 반영
3. 사용자에게 받을 정보 input box로 관리
2025-05-30 17:53:24 +09:00

23 lines
589 B
JavaScript

window.postWithHeader = function(url, method, headerKey, headerValue) {
fetch(url, {
method: method,
headers: {
[headerKey] : headerValue
}
}).then(res => {
if (res.redirected) {
window.location.href = res.url;
}
});
};
window.fetchWithHeaderAndReturnUrl = async function(url, method, headerKey, headerValue) {
const response = await fetch(url, {
method: method,
headers: {
[headerKey]: headerValue
}
});
const data = await response.json();
return data.url;
};