|
|
@@ -63,7 +63,12 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ref } from "vue";
|
|
|
import { useRouter } from "vue-router";
|
|
|
-import { motion } from "motion-v";
|
|
|
+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();
|
|
|
|
|
|
@@ -91,15 +96,46 @@ const goDetail = () => {
|
|
|
};
|
|
|
|
|
|
// 处理查看按钮点击事件
|
|
|
-const handleView = (item: Item) => {
|
|
|
+const handleView = async (item: Item) => {
|
|
|
console.log("查看", item);
|
|
|
// 如果有自定义路径,则跳转到指定路径
|
|
|
|
|
|
if (item.label === "OA办公系统") {
|
|
|
- window.open("https://yfoa.keruioil.com", "_blank");
|
|
|
+ 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"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ window.open("https://yfoa.keruioil.com", "_blank");
|
|
|
+ }
|
|
|
}
|
|
|
if (item.label === "设备管理系统 (PMS)") {
|
|
|
- window.open("https://aims.deepoil.cc", "_blank");
|
|
|
+ if (userStore.getUser.username && getAccessToken()) {
|
|
|
+ window.open(
|
|
|
+ "http://localhost:8080?sso=1&&username=" + userStore.getUser.username,
|
|
|
+ "_blank"
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ window.open("http://localhost:8080", "_blank");
|
|
|
+ }
|
|
|
}
|
|
|
if (item.label === "中航北斗智慧管理系统") {
|
|
|
window.open("https://zhbdgps.cn", "_blank");
|