|
@@ -140,21 +140,21 @@ const handleMsg = (state?: string) => {
|
|
|
if (event.origin === "https://login.dingtalk.com") {
|
|
if (event.origin === "https://login.dingtalk.com") {
|
|
|
let loginTmpCode = event.data;
|
|
let loginTmpCode = event.data;
|
|
|
console.log("收到钉钉扫码登录消息:", loginTmpCode);
|
|
console.log("收到钉钉扫码登录消息:", loginTmpCode);
|
|
|
- // window.location.href =
|
|
|
|
|
- // "https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=" +
|
|
|
|
|
- // import.meta.env.VITE_DINGTALK_APP_ID +
|
|
|
|
|
- // "&response_type=code&scope=snsapi_login&state=" +
|
|
|
|
|
- // state +
|
|
|
|
|
- // "&redirect_uri=" +
|
|
|
|
|
- // import.meta.env.VITE_DINGTALK_REDIRECT_URI +
|
|
|
|
|
- // "&loginTmpCode=" +
|
|
|
|
|
- // loginTmpCode;
|
|
|
|
|
|
|
+ window.location.href =
|
|
|
|
|
+ "https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=" +
|
|
|
|
|
+ import.meta.env.VITE_DINGTALK_APP_ID +
|
|
|
|
|
+ "&response_type=code&scope=snsapi_login&state=" +
|
|
|
|
|
+ state +
|
|
|
|
|
+ "&redirect_uri=" +
|
|
|
|
|
+ import.meta.env.VITE_DINGTALK_REDIRECT_URI +
|
|
|
|
|
+ "&loginTmpCode=" +
|
|
|
|
|
+ loginTmpCode;
|
|
|
|
|
|
|
|
- const res = await socialLogin("10", loginTmpCode as string, state!);
|
|
|
|
|
|
|
+ // const res = await socialLogin("20", loginTmpCode as string, "22");
|
|
|
|
|
|
|
|
- console.log("登录结果:", res);
|
|
|
|
|
|
|
+ // console.log("登录结果:", res);
|
|
|
|
|
|
|
|
- authUtil.setToken(res);
|
|
|
|
|
|
|
+ // authUtil.setToken(res);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|