manual v2
This commit is contained in:
parent
e63ba4b3cd
commit
2cf968ae7e
74 changed files with 913 additions and 21656 deletions
|
|
@ -1,25 +1,11 @@
|
|||
import axios from "axios"
|
||||
import config from "process"
|
||||
// import { dotnetPath } from "../path/axiosPath";
|
||||
// import { getToken } from "@baloise/vue-keycloak";
|
||||
import keycloak from "../plugins/keycloak"
|
||||
import axios from "axios";
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
withCredentials: false,
|
||||
})
|
||||
withCredentials: false,
|
||||
});
|
||||
|
||||
// axiosInstance.defaults.baseURL = dotnetPath;
|
||||
axiosInstance.interceptors.request.use(
|
||||
async (config) => {
|
||||
const token = await keycloak.token
|
||||
config.headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
}
|
||||
return config
|
||||
},
|
||||
(error) => {
|
||||
Promise.reject(error)
|
||||
}
|
||||
)
|
||||
axiosInstance.interceptors.request.use((error) => {
|
||||
Promise.reject(error);
|
||||
});
|
||||
|
||||
export default axiosInstance
|
||||
export default axiosInstance;
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
// /**
|
||||
// * front connect to keycloak
|
||||
// */
|
||||
// import Keycloak from "keycloak-js";
|
||||
// // import config from "../app.config";
|
||||
// // import http from "../shared/http";
|
||||
// // import router from "../router";
|
||||
|
||||
// const initOptions = {
|
||||
// // url: "https://keycloak.frappet.synology.me/auth/",
|
||||
// realm: "bma-ehr",
|
||||
// clientId: "bma-ehr-vue3",
|
||||
// url: "https://id.frappet.synology.me/",
|
||||
// // realm: "bma-ehr-exam",
|
||||
// // clientId: "bma-ehr-exam-vue3",
|
||||
// }; //option keycloak ที่จะ connect
|
||||
|
||||
// const keycloak = Keycloak(initOptions);
|
||||
|
||||
// keycloak.onAuthSuccess = () => {}; //เพิ่มlogin สำเร็จจะมาทำฟังก์ชันนี้
|
||||
|
||||
// await keycloak.init({ onLoad: "check-sso", checkLoginIframe: false }); //ทำการ connect keycloak
|
||||
// export default keycloak;
|
||||
Loading…
Add table
Add a link
Reference in a new issue