branch setzen
This commit is contained in:
@ -42,6 +42,7 @@
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"homepage____": "http://localhost:3000/dog",
|
||||
"homepage": "https://hope-fly.de/dog"
|
||||
"xxxhomepage____": "http://localhost:3000/dog",
|
||||
"xxxxhomepage": "https://hope-fly.de/dog",
|
||||
"homepage": "http://localhost/dog"
|
||||
}
|
||||
|
||||
@ -13,22 +13,22 @@ require __DIR__.'/classes/lib.php';
|
||||
$db_connection = new Database();
|
||||
$conn = $db_connection->dbConnection();
|
||||
|
||||
//$data = json_decode(file_get_contents("php://input"));
|
||||
$data = json_decode(
|
||||
'{
|
||||
"email": "a@q.q",
|
||||
"password": "qwertzui"
|
||||
}'
|
||||
);
|
||||
$data = json_decode(file_get_contents("php://input"));
|
||||
// $data = json_decode(
|
||||
// '{
|
||||
// "email": "a@q.q",
|
||||
// "password": "qwertzui"
|
||||
// }'
|
||||
// );
|
||||
$returnData = new CMsg(0);
|
||||
|
||||
// IF REQUEST METHOD IS NOT EQUAL TO POST
|
||||
// if($_SERVER["REQUEST_METHOD"] != "POST")
|
||||
// {
|
||||
// $returnData = new CMsg(0,404,'Page Not Found!');
|
||||
// echo $returnData->jsonarray();
|
||||
// return;
|
||||
// }
|
||||
//IF REQUEST METHOD IS NOT EQUAL TO POST
|
||||
if($_SERVER["REQUEST_METHOD"] != "POST")
|
||||
{
|
||||
$returnData = new CMsg(0,404,'Page Not Found! REQUEST_METHOD');
|
||||
echo $returnData->jsonarray();
|
||||
return;
|
||||
}
|
||||
|
||||
// CHECKING EMPTY FIELDS
|
||||
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">
|
||||
<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>
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import React from 'react'
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useParams, useSearchParams } from "react-router-dom";
|
||||
|
||||
export default function Dog()
|
||||
{
|
||||
const params = useParams();
|
||||
const params = useParams();
|
||||
const searchParams = useSearchParams();
|
||||
return (
|
||||
<div>
|
||||
<h1>Dog</h1>
|
||||
|
||||
@ -129,7 +129,8 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
|
||||
}
|
||||
else
|
||||
{
|
||||
const {data} = await Axios.get('session.php');
|
||||
const session = await Axios.get('session.php');
|
||||
const {data} = session;
|
||||
if(data.success && data.user)
|
||||
{
|
||||
setUser(data.user);
|
||||
|
||||
Reference in New Issue
Block a user