|
|
@@ -66,11 +66,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { onMounted, ref } from "vue";
|
|
|
+import { onMounted } from "vue";
|
|
|
import * as authUtil from "@/utils/auth";
|
|
|
import * as dd from "dingtalk-jsapi";
|
|
|
-import { ElLoading } from "element-plus";
|
|
|
-import { dingTalkLogin } from "@/api/user";
|
|
|
import Header from "@components/home/header.vue";
|
|
|
import CardItem from "@components/home/CardItem.vue";
|
|
|
import Footer from "@components/home/Footer.vue";
|
|
|
@@ -149,9 +147,6 @@ const cards: Card[] = [
|
|
|
},
|
|
|
];
|
|
|
|
|
|
-const loading2 = ref<any>(null);
|
|
|
-const redirect = ref<string>("");
|
|
|
-
|
|
|
async function loginWithDingTalk() {
|
|
|
const ddCorpId = import.meta.env.VITE_DD_CORPID;
|
|
|
const ddClientId = import.meta.env.VITE_DD_CLIENTID;
|
|
|
@@ -163,36 +158,6 @@ async function loginWithDingTalk() {
|
|
|
clientId: ddClientId,
|
|
|
success: (res: any) => {
|
|
|
const { code } = res;
|
|
|
- // dingTalkLogin({ code, type: 10, state: new Date().getTime() }).then(
|
|
|
- // async (res) => {
|
|
|
- // console.log("res :>> ", res);
|
|
|
- // loading2.value = ElLoading.service({
|
|
|
- // lock: true,
|
|
|
- // text: "正在加载系统中...",
|
|
|
- // background: "rgba(0, 0, 0, 0.7)",
|
|
|
- // });
|
|
|
-
|
|
|
- // authUtil.setToken(res);
|
|
|
-
|
|
|
- // if (!redirect.value) {
|
|
|
- // redirect.value = "/";
|
|
|
- // }
|
|
|
- // if (redirect.value.indexOf("sso") !== -1) {
|
|
|
- // window.location.href = window.location.href.replace(
|
|
|
- // "/login?redirect=",
|
|
|
- // "",
|
|
|
- // );
|
|
|
- // } else {
|
|
|
- // router
|
|
|
- // .push({
|
|
|
- // path: redirect.value,
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // loading2.value.close();
|
|
|
- // });
|
|
|
- // }
|
|
|
- // },
|
|
|
- // );
|
|
|
|
|
|
axios
|
|
|
.post(
|
|
|
@@ -213,17 +178,10 @@ async function loginWithDingTalk() {
|
|
|
console.log("钉钉免登res>>>>>>>>>>>>>>>>>>", res.data.data);
|
|
|
|
|
|
authUtil.setToken(res.data.data);
|
|
|
- if (!redirect.value) {
|
|
|
- redirect.value = "/";
|
|
|
- }
|
|
|
-
|
|
|
- router
|
|
|
- .push({
|
|
|
- path: redirect.value,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- loading2.value.close();
|
|
|
- });
|
|
|
+
|
|
|
+ router.push({
|
|
|
+ path: "/login",
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
fail: (err: any) => {
|