branch setzen
This commit is contained in:
@ -42,6 +42,7 @@
|
|||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"homepage____": "http://localhost:3000/dog",
|
"xxxhomepage____": "http://localhost:3000/dog",
|
||||||
"homepage": "https://hope-fly.de/dog"
|
"xxxxhomepage": "https://hope-fly.de/dog",
|
||||||
|
"homepage": "http://localhost/dog"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,22 +13,22 @@ require __DIR__.'/classes/lib.php';
|
|||||||
$db_connection = new Database();
|
$db_connection = new Database();
|
||||||
$conn = $db_connection->dbConnection();
|
$conn = $db_connection->dbConnection();
|
||||||
|
|
||||||
//$data = json_decode(file_get_contents("php://input"));
|
$data = json_decode(file_get_contents("php://input"));
|
||||||
$data = json_decode(
|
// $data = json_decode(
|
||||||
'{
|
// '{
|
||||||
"email": "a@q.q",
|
// "email": "a@q.q",
|
||||||
"password": "qwertzui"
|
// "password": "qwertzui"
|
||||||
}'
|
// }'
|
||||||
);
|
// );
|
||||||
$returnData = new CMsg(0);
|
$returnData = new CMsg(0);
|
||||||
|
|
||||||
// IF REQUEST METHOD IS NOT EQUAL TO POST
|
//IF REQUEST METHOD IS NOT EQUAL TO POST
|
||||||
// if($_SERVER["REQUEST_METHOD"] != "POST")
|
if($_SERVER["REQUEST_METHOD"] != "POST")
|
||||||
// {
|
{
|
||||||
// $returnData = new CMsg(0,404,'Page Not Found!');
|
$returnData = new CMsg(0,404,'Page Not Found! REQUEST_METHOD');
|
||||||
// echo $returnData->jsonarray();
|
echo $returnData->jsonarray();
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// CHECKING EMPTY FIELDS
|
// CHECKING EMPTY FIELDS
|
||||||
if(
|
if(
|
||||||
|
|||||||
40
src/Ap.xxx__tsx
Normal file
40
src/Ap.xxx__tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import {useContext} from 'react'
|
||||||
|
import './App.css';
|
||||||
|
import { BrowserRouter, Routes, Route, Navigate} from 'react-router-dom';
|
||||||
|
import "./App.css";
|
||||||
|
import Login from './components/Login';
|
||||||
|
import Register from './components/Register';
|
||||||
|
import Home from './components/Home';
|
||||||
|
import Dog from './components/Dog';
|
||||||
|
import {UserCtx, UserCtxT} from './context/UserContext';
|
||||||
|
|
||||||
|
|
||||||
|
function App()
|
||||||
|
{
|
||||||
|
const {user} = useContext<UserCtxT | null>(UserCtx) as UserCtxT;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="App">
|
||||||
|
<div className="col middle">
|
||||||
|
<BrowserRouter basename='/dog'>
|
||||||
|
<Routes>
|
||||||
|
{ user && <Route path="/" element={<Home/>} /> }
|
||||||
|
{ (
|
||||||
|
<>
|
||||||
|
{/* <Route path="/:qr_id" element={<Dog/>} /> */}
|
||||||
|
<Route path="/" element={<Home/>} />
|
||||||
|
<Route path="/d" element={<Dog/>} />
|
||||||
|
<Route path="/login" element={<Login/>} />
|
||||||
|
<Route path="/reg" element={<Register/>} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{/* <Route path="*" element={<Navigate to={user ? '/':'/login'} />} /> */}
|
||||||
|
</Routes>
|
||||||
|
</BrowserRouter>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
@ -19,15 +19,10 @@ function App()
|
|||||||
<div className="col middle">
|
<div className="col middle">
|
||||||
<BrowserRouter basename='/dog'>
|
<BrowserRouter basename='/dog'>
|
||||||
<Routes>
|
<Routes>
|
||||||
{ user && <Route path="/" element={<Home/>} /> }
|
<Route path="/" element={<Home/>} />
|
||||||
{ (
|
<Route path="/d" element={<Dog/>} />
|
||||||
<>
|
|
||||||
<Route path="/:qr_id" element={<Dog/>} />
|
|
||||||
<Route path="/login" element={<Login/>} />
|
<Route path="/login" element={<Login/>} />
|
||||||
<Route path="/reg" element={<Register/>} />
|
<Route path="/reg" element={<Register/>} />
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<Route path="*" element={<Navigate to={user ? '/':'/login'} />} />
|
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams, useSearchParams } from "react-router-dom";
|
||||||
|
|
||||||
export default function Dog()
|
export default function Dog()
|
||||||
{
|
{
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
|
const searchParams = useSearchParams();
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Dog</h1>
|
<h1>Dog</h1>
|
||||||
|
|||||||
@ -129,7 +129,8 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const {data} = await Axios.get('session.php');
|
const session = await Axios.get('session.php');
|
||||||
|
const {data} = session;
|
||||||
if(data.success && data.user)
|
if(data.success && data.user)
|
||||||
{
|
{
|
||||||
setUser(data.user);
|
setUser(data.user);
|
||||||
|
|||||||
Reference in New Issue
Block a user