diff --git a/src/assets/images/Noentry.jpg b/src/assets/images/Noentry.jpg new file mode 100644 index 00000000..5ffc34e1 Binary files /dev/null and b/src/assets/images/Noentry.jpg differ diff --git a/src/assets/images/banner/mainbanner.jpg b/src/assets/images/banner/mainbanner.jpg index e78f0f18..85edd39c 100644 Binary files a/src/assets/images/banner/mainbanner.jpg and b/src/assets/images/banner/mainbanner.jpg differ diff --git a/src/assets/images/competition_banner.jpg b/src/assets/images/competition_banner.jpg new file mode 100644 index 00000000..5354281b Binary files /dev/null and b/src/assets/images/competition_banner.jpg differ diff --git a/src/components/Header/components/User/index.tsx b/src/components/Header/components/User/index.tsx index c2cfac71..663dfb67 100644 --- a/src/components/Header/components/User/index.tsx +++ b/src/components/Header/components/User/index.tsx @@ -234,7 +234,7 @@ const User: FC = ({ }, }); - delCookie('autologin_trustie'); + delCookie('logintrustie'); delCookie('_educoder_session'); localStorage.removeItem('isfirst'); localStorage.removeItem('SystemUpdateadvtime'); @@ -271,17 +271,15 @@ const User: FC = ({ { const res = await ForgeLoginOut({}); - if (res?.status === 1) { - dispatch({ - type: 'user/getUserInfo', - payload: { - ...payload, - }, - }); - - delCookie('autologin'); - window.location.reload(); - } + dispatch({ + type: 'user/getUserInfo', + payload: { + ...payload, + }, + }); + window.location.reload(); + delCookie('autologin'); + delCookie('logintrustie'); }} >退出 @@ -322,7 +320,7 @@ const User: FC = ({ {/* {checkIsClientExam() && ( diff --git a/src/components/Header/index.less b/src/components/Header/index.less index f6316797..22af26f1 100755 --- a/src/components/Header/index.less +++ b/src/components/Header/index.less @@ -46,18 +46,18 @@ &.actived { a { - color: @primary; + color: #5091ff; } - &::after { - content: ''; - width: 18px; - height: 2px; - background-color: @primary; - position: absolute; - bottom: 14px; - left: 0; - } + // &::after { + // content: ''; + // width: 18px; + // height: 2px; + // background-color: @primary; + // position: absolute; + // bottom: 14px; + // left: 0; + // } } a { diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index e2647080..cdd82611 100755 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -262,7 +262,7 @@ const HeaderComponents: FC = ({
  • = ({ ) } })} - {(!checkIsClientExam() && !isLogin && globalSetting.setting?.main_site) &&
  • 工程认证 -
  • } + } */}
    { @@ -310,7 +310,8 @@ const HeaderComponents: FC = ({ {!isLogin && !!user?.userInfo?.login && } { - !!user?.userInfo?.login && {user?.userInfo?.message_unread_total && } + !!user?.userInfo?.login && + {user?.userInfo?.message_unread_total > 0 ? :""} } } diff --git a/src/components/User/PopLoginRegister/components/LoginPanel/LoginForm.tsx b/src/components/User/PopLoginRegister/components/LoginPanel/LoginForm.tsx index 0f52e58e..ee7fddc5 100644 --- a/src/components/User/PopLoginRegister/components/LoginPanel/LoginForm.tsx +++ b/src/components/User/PopLoginRegister/components/LoginPanel/LoginForm.tsx @@ -84,7 +84,6 @@ const LoginPopComponents = ({ dispatch,setType,user,setusername,globalSetting }: type: 'user/ForgeLogin', payload: { ...values ,autologin: values.autologin?1:0 }, }) - console.log(response) if (response.login) { //判断用户是否选择【下次自动登录】 setCookie('autologin',values.autologin,1); diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 90a90594..7241e876 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -4,11 +4,14 @@ import zhCN from 'antd/es/locale/zh_CN'; import UserPopLogin from '@/components/User/PopLoginRegister/PopLogin' import { Spin, Alert } from 'antd'; import { setLocale } from 'umi'; -import { trackEvent, trackEventCustom } from '@/utils/util'; +import { delCookie, trackEvent, trackEventCustom } from '@/utils/util'; import moment from 'moment'; import { connect, Loading, GlobalSettingModelState, UserModelState, Dispatch, useLocation } from 'umi'; import { getCourseParam } from '@/components/Header'; import ENV from '@/utils/env'; +import { Base64 } from 'js-base64'; +import { setCookie } from '@/utils/util'; + interface PageProps { loading: Loading, globalSetting: GlobalSettingModelState, @@ -46,12 +49,46 @@ const SimpleLayouts: FC = ({ loading, globalSetting, children, user, }, }) } + if (res?.username && loca.pathname === '/login') { location.href = "/" } }; + useEffect(()=>{ + delCookie("logintrustie"); + console.log("清除了"); + if(user?.userInfo?.profile_completed){ + getEducoderUserInfo(); + } + },[user?.userInfo]) + + const getEducoderUserInfo=async()=>{ + if(user?.userInfo?.profile_completed){ + delCookie("logintrustie"); + var res = await dispatch({ + type:"user/getEducoderUserInfo", + payload:{ + websiteName: "gitlink" , + openkey: Base64.encode("05e9081ede2e7425db064df44b5fb1897234f44f922443b89597d17b60dc8f3e"), + sign:"cdf0f69b4d5b4293f7914cc1f1f31742", + login: user?.userInfo?.login, + lastname:user?.userInfo?.real_name, + nickname:user?.userInfo?.nickname, + mail:user?.userInfo?.email, + school_name:user?.userInfo?.custom_department + } + }) + if(res && res.token){ + setCookie("logintrustie",res.token,1); + } + // setCookie("logintrustie","7e43fe5f1f10a8a78728fabc1d03c6a827e21f7e",1); + } + } + useEffect(() => { + delCookie("logintrustie"); + console.log("清除了"); getData(); }, [location.pathname]) useEffect(() => { diff --git a/src/models/user/index.ts b/src/models/user/index.ts index f5d92b99..f1b498df 100755 --- a/src/models/user/index.ts +++ b/src/models/user/index.ts @@ -1,6 +1,6 @@ import { Effect, Reducer, Subscription, history } from 'umi' import { Action } from '@@/plugin-dva/connect' -import { LoginIn, getUserInfo, getNavigationInfo , ForgeLogin } from '@/service/user' +import { LoginIn, getUserInfo, getNavigationInfo , ForgeLogin , getEducoderUserInfo } from '@/service/user' export interface UserModelState { name: string @@ -21,7 +21,8 @@ export interface UserModelType { getUserInfo: Effect getNavigationInfo: Effect setActionTabs: Effect; - ForgeLogin:Effect + ForgeLogin:Effect; + getEducoderUserInfo:Effect } reducers: { save: Reducer @@ -75,7 +76,7 @@ const UserModel: UserModelType = { return response; }, *getUserInfo({ payload }, { call, put }) { - // location.search + // location.search,,debug:"admin" const response = yield call(getUserInfo, { ...payload}) localStorage.userInfo = JSON.stringify(response); @@ -84,6 +85,10 @@ const UserModel: UserModelType = { payload: { userInfo: { ...response } }, }) }, + *getEducoderUserInfo({ payload }, { call, put }) { + const response = yield call(getEducoderUserInfo, { ...payload}) + return response; + }, *getNavigationInfo({ payload }, { call, put }) { const response = yield call(getNavigationInfo, { ...payload }) yield put({ diff --git a/src/pages/Competitions/Detail/index.tsx b/src/pages/Competitions/Detail/index.tsx index 81e3c648..76a0072d 100644 --- a/src/pages/Competitions/Detail/index.tsx +++ b/src/pages/Competitions/Detail/index.tsx @@ -12,7 +12,8 @@ import { } from 'umi'; import styles from './index.less'; import AuthModel from '@/components/AuthenticationModel' -import AddSubmitModel from './AddSubmitModel' +import AddSubmitModel from './AddSubmitModel'; +import { Base64 } from 'js-base64'; import { Breadcrumb, Button, Menu, message, Spin, Modal } from 'antd'; //查看内容 import SeeItem from './SeeItem'; @@ -21,8 +22,8 @@ import UpItem from './Update'; import RanKing from './Ranking'//排行榜 import Award from './AwardPdf' //获奖证书 import ENV from '@/utils/env'; -import { openNewWindow,setDocumentTitle } from '@/utils/util'; -import { handleVerifyLogin, handleVerify } from '@/utils/verifyLogin'; +import { getCookie, openNewWindow,setCookie,setDocumentTitle } from '@/utils/util'; +import { handleVerifyLogin, handleVerify , handleProfleCompletedModal } from '@/utils/verifyLogin'; import { isSuperAdmin } from '@/utils/authority'; import SubmitResult from './SubmitResult' import QR from './mCode.png'; @@ -97,8 +98,6 @@ const competitionDetails: FC = ({ setDocumentTitle('竞赛') }, [identifier]) useEffect(() => { - // console.log('--------',parseInt(loction?.query?.type)===1); - setisshowType(parseInt(loction?.query?.type) === 1) }, [loction]) @@ -153,12 +152,18 @@ const competitionDetails: FC = ({ } } + async function gotocourse(e: any, item: any, url: string) { e.stopPropagation(); if (!handleVerify(dispatch)) { return; } + // 判断是否完善资料,未完善资料需弹出提示框 + if(!handleProfleCompletedModal()){ + return; + } + if (HeaderDetail?.is_authentication && !user?.userInfo?.authentication) { dispatch({ type: 'shixunsDetail/setActionTabs', @@ -168,6 +173,11 @@ const competitionDetails: FC = ({ }) return } + if(item.identifier === "gcc-courses-2022" || item.identifier === "gcc_2022_projects_type2"){ + let arr = HeaderDetail.competition_modules?.filter((item:any)=>item.name === "赛事发布"); + arr && arr.length > 0 && getrightdatas(arr[0]); + return; + } if (url === "ismodel") { if (item.member_of_course === true) { openNewWindow(`/classrooms/${item.course_id}`) @@ -205,10 +215,8 @@ const competitionDetails: FC = ({ } }) if (competitionTeamsresult) { - message.info('报名成功,预祝您夺得桂冠!') } - } else { openNewWindow(url) } @@ -268,7 +276,6 @@ const competitionDetails: FC = ({ payload: { identifier: identifier, user_id: user?.userInfo?.user_id, - //user_id:39416 } }) setPrize(data); @@ -279,15 +286,11 @@ const competitionDetails: FC = ({ type: 'competitions/Accounts', payload: { id: user?.userInfo?.user_id, - //user_id:39416 } }) SetAccounts(data); } - // console.log('-------',useLocation().query.type); - - return (
    @@ -322,10 +325,18 @@ const competitionDetails: FC = ({ 浏览数
    {parseInt(HeaderDetail && HeaderDetail.visits_count).toLocaleString()}
    报名数
    {parseInt(HeaderDetail && HeaderDetail.member_count).toLocaleString()}

    - {HeaderDetail.competition_status === "ended" ? : null} - {HeaderDetail.competition_status === 'nearly_published' ? : null} - {HeaderDetail.competition_status !== 'nearly_published' && HeaderDetail.enroll_end && HeaderDetail.competition_status !== 'ended' ? : null} - {HeaderDetail.competition_status === 'progressing' && HeaderDetail.enroll_end != true ? : null + } + {HeaderDetail.competition_status === 'nearly_published' ? + : null + } + { + HeaderDetail.competition_status !== 'nearly_published' && HeaderDetail.enroll_end && HeaderDetail.competition_status !== 'ended' ? + : null + } + {HeaderDetail.competition_status === 'progressing' && HeaderDetail.enroll_end != true ? : null} + }>{StaffDetail.enrolled ? HeaderDetail.need_attachment ? '上传作品' : '已报名' : (HeaderDetail.identifier === "gcc-courses-2022" || HeaderDetail.identifier === "gcc_2022_projects_type2" ? "前往“赛事发布”板块报名":'立即报名')} : null} {user.userInfo.real_name != "游客" && gotocourse(e, HeaderDetail, `/competitions/index/${HeaderDetail.identifier}/enroll`)} className={styles.myteam}>{isSuperAdmin() ? '参赛战队>>' : '我的战队>>'}}
    diff --git a/src/pages/Competitions/Entered/Assembly/TeamsNota.tsx b/src/pages/Competitions/Entered/Assembly/TeamsNota.tsx index 90403732..70978047 100644 --- a/src/pages/Competitions/Entered/Assembly/TeamsNota.tsx +++ b/src/pages/Competitions/Entered/Assembly/TeamsNota.tsx @@ -11,7 +11,7 @@ interface Nulldata{ function Nulldata({setIsAddmodel,setJoin,HeaderDetail,user,dispatch}:Nulldata){ return(
    - +

    您当前未报名,请先{ if(HeaderDetail?.is_authentication&&!user?.userInfo?.authentication){ dispatch({ diff --git a/src/pages/Competitions/Entered/Enteredmodel/DownStudents.tsx b/src/pages/Competitions/Entered/Enteredmodel/DownStudents.tsx index 18c4ffaa..7395b1b9 100644 --- a/src/pages/Competitions/Entered/Enteredmodel/DownStudents.tsx +++ b/src/pages/Competitions/Entered/Enteredmodel/DownStudents.tsx @@ -33,7 +33,7 @@ function DownStudent({students,setTeams,Teams,HeaderDetail}:DownStudent){ students.push(item); setTeams(students) }}> - + {item.name||'- -'} {item.phone||'- -'} {item.student_id?'学号'+item.student_id:'- -'} diff --git a/src/pages/Competitions/Entered/Enteredmodel/DownTeacher.tsx b/src/pages/Competitions/Entered/Enteredmodel/DownTeacher.tsx index 7d717767..9652de46 100644 --- a/src/pages/Competitions/Entered/Enteredmodel/DownTeacher.tsx +++ b/src/pages/Competitions/Entered/Enteredmodel/DownTeacher.tsx @@ -31,7 +31,7 @@ function Downteacher({teachers,setTeams,Teams,HeaderDetail}:Downteacher){ teachers.push(item); setTeams(teachers) }}> - + {item.name||'- -'} {item.phone||'- -'} {item.identity||'- -'} diff --git a/src/pages/Competitions/Entered/Enteredmodel/SetmembersModel.tsx b/src/pages/Competitions/Entered/Enteredmodel/SetmembersModel.tsx index d9a03290..bbea1ed2 100644 --- a/src/pages/Competitions/Entered/Enteredmodel/SetmembersModel.tsx +++ b/src/pages/Competitions/Entered/Enteredmodel/SetmembersModel.tsx @@ -8,6 +8,7 @@ import Teammember from './Teammembers' import TeacherList from './DownTeacher' import StudentList from './DownStudents' +import { Base64 } from 'js-base64'; //设置战队成员 interface Setmember { Membersshow: any @@ -58,7 +59,9 @@ function Setmembers({ Membersshow,setClose,HeaderDetail, StaffDetail,setMembers, payload: { identifier: identifier, keyword: studentname, - team_id: mydatas && mydatas.id + team_id: mydatas && mydatas.id, + openkey: Base64.encode("05e9081ede2e7425db064df44b5fb1897234f44f922443b89597d17b60dc8f3e"), + sign:"cdf0f69b4d5b4293f7914cc1f1f31742", } }) if (data) { @@ -71,6 +74,8 @@ function Setmembers({ Membersshow,setClose,HeaderDetail, StaffDetail,setMembers, let data = await dispatch({ type: 'competitions/getTeacher', payload: { + openkey: Base64.encode("05e9081ede2e7425db064df44b5fb1897234f44f922443b89597d17b60dc8f3e"), + sign:"cdf0f69b4d5b4293f7914cc1f1f31742", identifier: identifier, keyword: teachname, team_id: mydatas && mydatas.id @@ -85,6 +90,7 @@ function Setmembers({ Membersshow,setClose,HeaderDetail, StaffDetail,setMembers, async function submitTeam() { let member_ids: any = []; let teacher_ids: any = []; + let gitlink_users:any=[]; Teams && Teams.map((item: any, index: any) => { if (item.is_teacher) { @@ -92,7 +98,15 @@ function Setmembers({ Membersshow,setClose,HeaderDetail, StaffDetail,setMembers, } else { member_ids.push(item.id) } + gitlink_users.push({ + login: item.login, + lastname:item.lastname, + nickname:item.nickname, + mail:item.mail, + school_name:item.school_name + }) }) + console.log("addTeam:",gitlink_users); setTeacherNumber(teacher_ids.length); setStudentNumber(member_ids.length); @@ -111,11 +125,14 @@ function Setmembers({ Membersshow,setClose,HeaderDetail, StaffDetail,setMembers, let data = await dispatch({ type: 'competitions/SubmitTeam', payload: { + openkey: Base64.encode("05e9081ede2e7425db064df44b5fb1897234f44f922443b89597d17b60dc8f3e"), + sign:"cdf0f69b4d5b4293f7914cc1f1f31742", identifier: identifier, teamid: mydatas && mydatas.id, member_ids: member_ids, teacher_ids: teacher_ids, - leader: loaderid + leader: loaderid, + gitlink_users:gitlink_users } }) if (data && data.status === 0) { diff --git a/src/pages/Competitions/Entered/Enteredmodel/Teammembers.tsx b/src/pages/Competitions/Entered/Enteredmodel/Teammembers.tsx index 5b529337..e5005a03 100644 --- a/src/pages/Competitions/Entered/Enteredmodel/Teammembers.tsx +++ b/src/pages/Competitions/Entered/Enteredmodel/Teammembers.tsx @@ -51,7 +51,7 @@ function Teammember({ teamitem, index, setTeams, Teams, setLoaderid }: Teammembe return (

    - + -1 ? teamitem.image_url : (ENV.IMG_SERVER + `/images/` + teamitem.image_url)}`} /> {teamitem && teamitem.name.length > 6 ? teamitem.name.substring(0, 6) + '...' : teamitem.name} {teamitem && teamitem.phone || '- -'} {teamitem && teamitem.school_name.length > 6 ? teamitem.school_name.substring(0, 6) + '...' : teamitem.school_name || '- - '} @@ -67,7 +67,7 @@ function Teammember({ teamitem, index, setTeams, Teams, setLoaderid }: Teammembe
    - setleader()}>{teamitem && teamitem.role === "leader" || teamitem && teamitem.creator ? '' : '设为队长'} + {/* setleader()}>{teamitem && teamitem.role === "leader" || teamitem && teamitem.creator ? '' : '设为队长'} */} deleteitem()} className={` ${styles.deleteitem}`}>{teamitem && teamitem.role === "leader" || teamitem && teamitem.creator ? '' : '删除'}
    diff --git a/src/pages/Competitions/Entered/index.tsx b/src/pages/Competitions/Entered/index.tsx index a1a27abb..5995fb4e 100644 --- a/src/pages/Competitions/Entered/index.tsx +++ b/src/pages/Competitions/Entered/index.tsx @@ -327,7 +327,7 @@ const competitionDetails: FC = ({ } })} - {isSelect || ManagedTeams && ManagedTeams.map((item: any, index: any) => { + {isSelect || ManagedTeams && ManagedTeams.length>0 && ManagedTeams.map((item: any, index: any) => { if (index === 0) { return (
    diff --git a/src/pages/Competitions/Index/index.tsx b/src/pages/Competitions/Index/index.tsx index 9b5f17f7..caa59174 100755 --- a/src/pages/Competitions/Index/index.tsx +++ b/src/pages/Competitions/Index/index.tsx @@ -18,7 +18,7 @@ import ENV from '@/utils/env' import AuthModel from '@/components/AuthenticationModel' import { isSuperAdmins } from '@/utils/authority' import { openNewWindow } from '@/utils/util'; -import { handleVerifyLogin, handleVerify } from '@/utils/verifyLogin'; +import { handleVerifyLogin, handleVerify , handleProfleCompletedModal} from '@/utils/verifyLogin'; import StatisticsItem from './Statistics/index' import { mainbannerBg } from '@/components/ImagesIcon'; import AdverModel from '@/components/HomeModal/Advertisement' @@ -63,7 +63,7 @@ const competitionsPage: FC = ({ // getHomeNotice(); dispatch({ type: 'competitions/getList', - payload: { ...competitions.listParams }, + payload: { ...competitions.listParams,external:true }, }); }, [competitions.name]); useEffect(() => { @@ -95,7 +95,7 @@ const competitionsPage: FC = ({ competitions.listParams.page = current; dispatch({ type: 'competitions/getList', - payload: { ...competitions.listParams, edu: location.query.edu }, + payload: { ...competitions.listParams, edu: location.query.edu , external:true }, }); }; @@ -109,6 +109,10 @@ const competitionsPage: FC = ({ if (!handleVerify(dispatch)) { return; } + // 判断是否完善资料,未完善资料需弹出提示框 + if(!handleProfleCompletedModal()){ + return; + } if (item?.is_authentication && !user?.userInfo?.authentication) { dispatch({ type: 'shixunsDetail/setActionTabs', @@ -118,6 +122,10 @@ const competitionsPage: FC = ({ }) return } + if(item.identifier === "gcc-courses-2022" || item.identifier === "gcc_2022_projects_type2"){ + openNewWindow(`/competitions/index/${item.identifier}`); + return; + } if (url === "ismodel") { if (item.member_of_course === true) { openNewWindow(`/classrooms/${item.course_id}`) @@ -175,7 +183,7 @@ const competitionsPage: FC = ({ @@ -198,7 +206,7 @@ const competitionsPage: FC = ({ competitions.listParams.page = 1; dispatch({ type: 'competitions/getList', - payload: { ...competitions.listParams }, + payload: { ...competitions.listParams,external:true }, }); }} > @@ -239,7 +247,7 @@ const competitionsPage: FC = ({ style={{ marginBottom: '0px' }} avatar={
    - +
    } title={

    = ({ {item && item.competition_status === 'progressing' && item.enroll_end != true ? : null} + } style={{ cursor: 'pointer'}}>立即报名 : null}

    diff --git a/src/service/competitions.ts b/src/service/competitions.ts index 35e9798c..c076bd45 100755 --- a/src/service/competitions.ts +++ b/src/service/competitions.ts @@ -94,14 +94,14 @@ export async function JoinTeam(params:any){ } //查找老师 export async function getTeacher(params:any){ - return Fetch(`/api/competitions/${params.identifier}/teachers.json?`,{ + return Fetch(`/api/competitions/${params.identifier}/teachers.json`,{ method:'get', params }); } //查找学生 export async function getStudents(params:any){ - return Fetch(`/api/competitions/${params.identifier}/students.json?`,{ + return Fetch(`/api/competitions/${params.identifier}/students.json`,{ method:'get', params }); diff --git a/src/service/user.ts b/src/service/user.ts index c4d20a67..3551b2d7 100755 --- a/src/service/user.ts +++ b/src/service/user.ts @@ -31,6 +31,12 @@ export async function getUserInfo(params: any) { params: {...params,} }); } +export async function getEducoderUserInfo(params: any) { + return Fetch(`/api/users/get_user_info.json`, { + method: 'get', + params: {...params} + }); +} export async function getNavigationInfo(params: any) { return Fetch('/api/users/get_navigation_info.json', { method: 'get', diff --git a/src/utils/fetch.ts b/src/utils/fetch.ts index abb30412..9dd91c5e 100755 --- a/src/utils/fetch.ts +++ b/src/utils/fetch.ts @@ -4,6 +4,7 @@ import { notification, message, Modal } from 'antd' import hash from 'hash.js' import { useDispatch, getDvaApp, history } from 'umi' import { reportData } from 'monitor-error-ll' +import { getCookie } from './util'; let modalConfirm: any; const codeMessage: any = { 200: '服务器成功返回请求的数据。', @@ -121,10 +122,11 @@ export default function request(url: string, option: any, flag?: boolean) { const defaultOptions = { credentials: 'include', - withCredentials: true, + withCredentials: true } let newOptions = { ...defaultOptions, ...options } + if ( newOptions.method === 'POST' || newOptions.method === 'PUT' || @@ -140,21 +142,26 @@ export default function request(url: string, option: any, flag?: boolean) { newOptions.body = JSON.stringify(options.body) } else { newOptions.headers = { - ...newOptions.headers, + ...newOptions.headers } newOptions.body = options.body } } - if (newOptions.method == 'GET') { newOptions.headers = { Accept: 'application/json', 'Content-Type': 'application/json; charset=utf-8', - ...newOptions.headers, + ...newOptions.headers } url += '?' + parseParams(options.params) } + if(url.indexOf("get_user_info") === -1 && getCookie("logintrustie")){ + newOptions.headers={ + ...newOptions.headers, + Authorization:getCookie("logintrustie") + } + } // newOptions.headers.Authorization = // 'Bearer 09cb06de7874a0cfae0608ba5126b3b30dcb5d2a' // if (localStorage.getItem('xhr-user-info')) { diff --git a/src/utils/util.tsx b/src/utils/util.tsx index 4d5b2c8f..324e725a 100755 --- a/src/utils/util.tsx +++ b/src/utils/util.tsx @@ -633,7 +633,7 @@ export function setCookie(cname: string, cvalue: string, exdays: number) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); - document.cookie = cname + "=" + cvalue + "; " + expires; + document.cookie = cname + "=" + cvalue + "; " + expires+";path=/;"; } diff --git a/src/utils/verifyLogin.tsx b/src/utils/verifyLogin.tsx index 85766513..6cf85824 100644 --- a/src/utils/verifyLogin.tsx +++ b/src/utils/verifyLogin.tsx @@ -44,7 +44,7 @@ export const handleProfleCompletedModal = () => { okText: `立即完善`, cancelText: "稍后完善", onOk: () => { - history.push('/account/profile/edit'); + window.location.href=`${ENV.FORGE_SERVER}/settings/profile`; } })