fixing
This commit is contained in:
parent
ad0973249e
commit
8979672717
2 changed files with 9 additions and 5 deletions
|
|
@ -134,6 +134,7 @@ async function logout() {
|
||||||
}).onOk(async () => {
|
}).onOk(async () => {
|
||||||
await deleteCookie(cookieTokenName.value);
|
await deleteCookie(cookieTokenName.value);
|
||||||
await deleteCookie(cookieTokenRefName.value);
|
await deleteCookie(cookieTokenRefName.value);
|
||||||
|
await deleteCookie("uid");
|
||||||
// ยิง logout เข้าระบบ
|
// ยิง logout เข้าระบบ
|
||||||
await postSaveLog("ออกจากระบบ", token.value);
|
await postSaveLog("ออกจากระบบ", token.value);
|
||||||
window.location.href = `${config.API.URL_SSO}`;
|
window.location.href = `${config.API.URL_SSO}`;
|
||||||
|
|
@ -152,8 +153,8 @@ async function postSaveLog(type: string, token: any) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
console.log("res:", res.data);
|
console.log("res:", res);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error("Error:", err);
|
console.error("Error:", err);
|
||||||
|
|
@ -166,11 +167,12 @@ onMounted(async () => {
|
||||||
deleteCookie("BMAHRISCKI_KEYCLOAK_IDENTITY");
|
deleteCookie("BMAHRISCKI_KEYCLOAK_IDENTITY");
|
||||||
deleteCookie("BMAHRISUSER_KEYCLOAK_IDENTITY");
|
deleteCookie("BMAHRISUSER_KEYCLOAK_IDENTITY");
|
||||||
|
|
||||||
const uid = route.query.uid?.toString() || "";
|
const uid = route.query.uid?.toString() || getCookie("uid");
|
||||||
|
const serve = route.query.uid ? "sso" : "uat";
|
||||||
await axios
|
await axios
|
||||||
.post(
|
.post(
|
||||||
`${config.API.sso}/kcauth`,
|
`${config.API.sso}/kcauth`,
|
||||||
{ uid },
|
{ uid, serve },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import config from "@/app.config";
|
||||||
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { setCookie } from "@/plugins/cookie";
|
||||||
|
|
||||||
// const $q = useQuasar();
|
// const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -41,8 +42,9 @@ async function onSubmit() {
|
||||||
withCredentials: true, // Include cookies with the request
|
withCredentials: true, // Include cookies with the request
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
if (res.data === "OK") {
|
if (res.data === "OK") {
|
||||||
|
await setCookie("uid", username.value, 1);
|
||||||
router.push("/");
|
router.push("/");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue