|
|
@@ -50,6 +50,34 @@ function login(event) { |
|
|
|
event.stopPropogation() |
|
|
|
} |
|
|
|
|
|
|
|
function getUser(app) { |
|
|
|
fetch("/panel/user", { |
|
|
|
method: 'GET', |
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
'Accept': 'application/json', |
|
|
|
'X-XSRF-TOKEN': token}, |
|
|
|
}).then(response => { |
|
|
|
return response.json() |
|
|
|
}).then(data => { |
|
|
|
app.user = data |
|
|
|
}) |
|
|
|
/* return this.user.name */ |
|
|
|
} |
|
|
|
|
|
|
|
function getOrders(app) { |
|
|
|
fetch("/panel/orders", { |
|
|
|
method: 'GET', |
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
'Accept': 'application/json', |
|
|
|
'X-XSRF-TOKEN': token}, |
|
|
|
}).then(response => { |
|
|
|
return response.json() |
|
|
|
}).then(data => { |
|
|
|
app.orders = data |
|
|
|
}) |
|
|
|
/* return this.user.name */ |
|
|
|
} |
|
|
|
|
|
|
|
//Attempt to resend the verification link |
|
|
|
function resendLink(event) { |
|
|
|
fetch("/resend-verification", { |
|
|
@@ -113,5 +141,6 @@ if (window.location.pathname == '/') { |
|
|
|
if (!token) {getToken(app)} |
|
|
|
const app = createApp(Panel).mount('#panel') |
|
|
|
window.onhashchange = ()=>{app.active = location.hash} |
|
|
|
getUser(app) |
|
|
|
} |
|
|
|
|