auto push

This commit is contained in:
kinou-p 2023-06-15 18:17:04 +02:00
parent d6356c6520
commit 25b955030b
4 changed files with 6 additions and 5 deletions

View File

@ -1 +1,2 @@
BASE_URL=192.168.1.19
REACT_APP_BASE_URL=192.168.1.19
# REACT_APP_BASE_URL=192.168.1.19

View File

@ -4,7 +4,7 @@
function Logout(){
localStorage.clear();
const path = 'http://' + process.env.BASE_URL + '/';
const path = 'http://' + process.env.REACT_APP_BASE_URL + '/';
// history(path, { replace: true });
// window.location.replace(path);
// window.history.pushState({}, '', path);

View File

@ -26,7 +26,7 @@ function HomeLogin()
return ;
}
// else
let path = "https://api.intra.42.fr/oauth/authorize?client_id=u-s4t2ud-6d29dfa49ba7146577ffd8bf595ae8d9e5aaa3e0a9615df18777171ebf836a41&redirect_uri=http%3A%2F%2F" + process.env.BASE_URL + "%3A80%2Fapi%2Fauth%2Flogin&response_type=code";
let path = "https://api.intra.42.fr/oauth/authorize?client_id=u-s4t2ud-6d29dfa49ba7146577ffd8bf595ae8d9e5aaa3e0a9615df18777171ebf836a41&redirect_uri=http%3A%2F%2F" + process.env.REACT_APP_BASE_URL + "%3A80%2Fapi%2Fauth%2Flogin&response_type=code";
window.location.replace(path);
};

View File

@ -13,12 +13,12 @@ console.log(`getToken = ${getToken()}`)
console.log(`Bearer ${localStorage.getItem("token")}`)
const test = "192.168.1.19"
// const url = 'http://' + process.env.BASE_URL + '/api'
// const url = 'http://' + process.env.REACT_APP_BASE_URL + '/api'
const url = 'http://' + test + '/api'
console.log("url= ", url)
console.log("test= ", test)
console.log("env= ", process.env.BASE_URL)
console.log("env= ", process.env.REACT_APP_BASE_URL)
let api = axios.create({
// baseURL: 'http://localhost/api',