|
|
@@ -68,7 +68,6 @@ import { ssoLogin } from "@/api/user";
|
|
|
import { useUserStore } from "@/stores/useUserStore";
|
|
|
import { getAccessToken } from "@/utils/auth";
|
|
|
const userStore = useUserStore();
|
|
|
-import axios from "axios";
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
@@ -102,27 +101,16 @@ const handleView = async (item: Item) => {
|
|
|
|
|
|
if (item.label === "OA办公系统") {
|
|
|
if (userStore.getUser.username && getAccessToken()) {
|
|
|
- const res = axios
|
|
|
- .post(
|
|
|
- "/api/oa",
|
|
|
- {
|
|
|
- appid: "d4a44f9d-e5d7-41d5-a582-fc1efcc936c4",
|
|
|
- loginid: userStore.getUser.username,
|
|
|
- },
|
|
|
- {
|
|
|
- headers: {
|
|
|
- "Content-Type": `application/x-www-form-urlencoded`,
|
|
|
- },
|
|
|
- }
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
- if (res.status === 200) {
|
|
|
- window.open(
|
|
|
- "https://yfoa.keruioil.com/wui/index.html?ssoToken=" + res.data,
|
|
|
- "_blank"
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
+ const res = await ssoLogin({
|
|
|
+ username: userStore.getUser.username,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ window.open(
|
|
|
+ "https://yfoa.keruioil.com/wui/index.html?ssoToken=" + res,
|
|
|
+ "_blank"
|
|
|
+ );
|
|
|
+ }
|
|
|
} else {
|
|
|
window.open("https://yfoa.keruioil.com", "_blank");
|
|
|
}
|