forum added

This commit is contained in:
CHIEFSOFT\ameye
2025-12-28 20:14:57 -05:00
parent c3f565ebe8
commit b58d576e86
2 changed files with 38 additions and 22 deletions
+27 -11
View File
@@ -1,4 +1,5 @@
import axios from "axios"
import {string} from "yup";
axios.interceptors.request.use(
@@ -10,9 +11,9 @@ axios.interceptors.request.use(
// "Access-Control-Allow-Headers": "Origin, X-API-KEY, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Headers, Authorization, observe, enctype, Content-Length, X-Csrf-Token",
// "Content-Type": "application/json;charset=UTF-8",
// 'Authorization': (localStorage && localStorage.getItem('access_token')) ? `Bearer ${localStorage.getItem('access_token')}` : '',
};
// config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`;
// config.baseURL = process.env.REACT_APP_MAIN_API
};
// config.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`;
// config.baseURL = process.env.REACT_APP_MAIN_API
return config;
},
error => {
@@ -20,15 +21,23 @@ axios.interceptors.request.use(
}
);
const postAuxEnd = (path, postData, media=false) => {
const blogBasePath = () => {
return 'https://blogdata.chiefsoft.net';
}
const siteServerPath = () => {
// NEXT_PUBLIC_APP_MAIN_API="https://devapi.mermsemr.com"
return 'https://devapi.mermsemr.com';
}
const postAuxEnd = (path, postData, media = false) => {
const basePath = media ? 'https://blogdata.chiefsoft.net' : 'https://blogdata.chiefsoft.net'
let newPostData = {}
if(!media){
if (!media) {
newPostData = {...postData}
}else{
} else {
newPostData = new FormData();
for (let data in postData) {
newPostData.append(data, postData[data]);
newPostData.append(data, postData[data]);
}
}
return axios.post(`${basePath}${path}`, newPostData).then(res => {
@@ -39,9 +48,9 @@ const postAuxEnd = (path, postData, media=false) => {
})
}
const getAuxEnd = (path, reqData= null) => {
const basePath = 'https://blogdata.chiefsoft.net'
return axios.get(`${basePath}${path}`,{ params: reqData }).then(res => {
const getAuxEnd = (basePath, path, reqData = null) => {
// const basePath = 'https://blogdata.chiefsoft.net'
return axios.get(`${basePath}${path}`, {params: reqData}).then(res => {
return res
// localStorage.clear();
// window.location.href = `/login?sessionExpired=true`;
@@ -57,5 +66,12 @@ export const getMermsBlogs = (reqData) => {
let postData = {
...reqData
}
return getAuxEnd('/mermsblogdata/mermsemr', postData, false)
return getAuxEnd(blogBasePath(), '/mermsblogdata/mermsemr', postData)
}
export const serMermsWebContact = (reqData) => {
let postData = {
...reqData
}
return getAuxEnd(siteServerPath(), '/mermsblogdata/mermsemr', postData)
}