mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 05:38:23 +08:00
feat: custom request headers
This commit is contained in:
parent
bc293b8fef
commit
85882f7c7a
@ -59,6 +59,7 @@ export class APIClient {
|
||||
authMiddleware() {
|
||||
this.axios.interceptors.request.use((config) => {
|
||||
const token = localStorage.getItem(this.tokenKey);
|
||||
config.headers['X-Hostname'] = window.location.hostname;
|
||||
if (token) {
|
||||
config.headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user