header + navigation and menu

This commit is contained in:
hamid zarghami
2025-08-03 15:53:06 +03:30
parent 61a934074c
commit 76500fb337
46 changed files with 1042 additions and 154 deletions
+28
View File
@@ -0,0 +1,28 @@
import axios from "axios";
import { getToken } from "./func";
import { BASE_URL } from "./const";
// import { Pages } from "./Pages";
const axiosInstance = axios.create({
// baseURL: process.env.NEXT_PUBLIC_BASE_URL,
baseURL: BASE_URL,
});
axiosInstance.interceptors.response.use(
(response) => response,
(error) => {
return Promise.reject(error);
}
);
axiosInstance.interceptors.request.use(async function (config) {
const tokenValue = await getToken();
const token = tokenValue ? tokenValue : "";
if (token) {
config.headers.Authorization = "Bearer " + token;
}
return config;
});
export default axiosInstance;
+1
View File
@@ -1,2 +1,3 @@
export const TOKEN_NAME = "sh_token";
export const REFRESH_TOKEN_NAME = "sh_refresh_token";
export const BASE_URL = "https://api.shinan.ir";