♻️ refactor(helpers): refactor the helpers folder and related imports

This commit is contained in:
Apple\Apple
2025-06-03 23:56:39 +08:00
parent 1a8888211f
commit 61d1add156
39 changed files with 523 additions and 589 deletions

10
web/src/helpers/auth.js Normal file
View File

@@ -0,0 +1,10 @@
export function authHeader() {
// return authorization header with jwt token
let user = JSON.parse(localStorage.getItem('user'));
if (user && user.token) {
return { Authorization: 'Bearer ' + user.token };
} else {
return {};
}
}