|
|
@@ -1,6 +1,6 @@
|
|
|
"use client";
|
|
|
|
|
|
-import { Modal} from "antd";
|
|
|
+import { Modal } from "antd";
|
|
|
|
|
|
require("../polyfill");
|
|
|
import { useState, useEffect } from "react";
|
|
|
@@ -316,20 +316,21 @@ export function Home() {
|
|
|
const jkLogin = async (data: { code: string, redirectUrl: string }, url: string) => {
|
|
|
try {
|
|
|
const res = await api.post('jk_code_login', data);
|
|
|
- console.log(res,'res')
|
|
|
localStorage.setItem('userInfo', JSON.stringify(res.data));
|
|
|
window.open(url, '_self');
|
|
|
- } catch (error:any) {
|
|
|
+ } catch (error: any) {
|
|
|
Modal.error({
|
|
|
title: '登录失败',
|
|
|
content: error.msg,
|
|
|
})
|
|
|
- // const originUrl = window.location.origin;
|
|
|
- // window.open(originUrl, '_self');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
useEffect(() => {
|
|
|
+ // const loginRes = null;
|
|
|
+ // if (loginRes) {
|
|
|
+ // return localStorage.setItem('userInfo', JSON.stringify(loginRes));
|
|
|
+ // }
|
|
|
const originUrl = window.location.origin;
|
|
|
const fullUrl = window.location.href;
|
|
|
const urlParams = new URLSearchParams(new URL(fullUrl).search);
|