|
|
@@ -82,6 +82,7 @@ import bg2 from "@/assets/images/e4.png";
|
|
|
import g1 from "@/assets/images/g1.png";
|
|
|
import { useRouter } from "vue-router";
|
|
|
const router = useRouter();
|
|
|
+import axios from "axios";
|
|
|
|
|
|
type Card = {
|
|
|
name: string;
|
|
|
@@ -162,36 +163,68 @@ 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);
|
|
|
-
|
|
|
+ // 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(
|
|
|
+ "https://portal.deepoil.cc/admin-api/system/auth/h5SocialLogin",
|
|
|
+ {
|
|
|
+ code: code,
|
|
|
+ type: 20,
|
|
|
+ state: new Date().getTime(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headers: {
|
|
|
+ "Content-Type": `application/json`,
|
|
|
+ "tenant-id": "1",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ console.log("钉钉免登res>>>>>>>>>>>>>>>>>>", res);
|
|
|
+
|
|
|
+ authUtil.setToken(res.data);
|
|
|
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();
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- );
|
|
|
+
|
|
|
+ router
|
|
|
+ .push({
|
|
|
+ path: redirect.value,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ loading2.value.close();
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
fail: (err: any) => {
|
|
|
console.log("err :>> ", err);
|