update bug

This commit is contained in:
caishi 2023-04-23 14:22:52 +08:00
parent 6cb2d854b7
commit 338d643862
10 changed files with 109 additions and 64 deletions

2
package-lock.json generated
View File

@ -18928,7 +18928,7 @@
},
"stealthy-require": {
"version": "1.1.1",
"resolved": "https://registry.nlark.com/stealthy-require/download/stealthy-require-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
},
"store": {

View File

@ -78,7 +78,8 @@ const SimpleLayouts: FC<PageProps> = ({ loading, globalSetting, children, user,
lastname:user?.userInfo?.real_name,
nickname:user?.userInfo?.nickname,
mail:user?.userInfo?.email,
school_name:user?.userInfo?.custom_department
school_name:user?.userInfo?.custom_department,
phone:user?.userInfo?.phone
}
})
if(res && res.token){

View File

@ -7,6 +7,7 @@ export interface UserModelState {
showPopLogin: boolean
loading: boolean
userInfo?: any
eduUserInfo?:any,
navigationInfo: any
actionTabs: { key: string; params: any ,phone:string};
showClosable: boolean
@ -45,6 +46,7 @@ const UserModel: UserModelType = {
showClosable: false,
// 用户信息
userInfo: {},
eduUserInfo:{},
navigationInfo: {},
loading: true,
actionTabs:{
@ -101,6 +103,10 @@ const UserModel: UserModelType = {
},
*getEducoderUserInfo({ payload }, { call, put }) {
const response = yield call(getEducoderUserInfo, { ...payload})
yield put({
type: 'save',
payload: { eduUserInfo: { ...response } },
})
return response;
},
*getNavigationInfo({ payload }, { call, put }) {

View File

@ -208,15 +208,33 @@ const competitionDetails: FC<PageProps> = ({
async function gotocourse(e: any, item: any, url: string) {
e.stopPropagation();
// if(HeaderDetail.teacher_need_phone||HeaderDetail.member_need_phone){
// setshowphone(true)
// return
// }
if (!handleVerify(dispatch)) {
return;
}
let data =await dispatch({
type: 'competitions/GetKylinId',
payload: {
owner:user?.userInfo?.login
}
})
let a =data.data;
let filter = a.filter((i:any)=>i.toString() === item?.id.toString());
let flag = filter && filter.length>0 ? true : false;
if(flag){
if(!user?.userInfo?.sign_cla){
setVisible(true);
return;
}
}else{
if(HeaderDetail.teacher_need_phone||HeaderDetail.member_need_phone){
setshowphone(true)
return
}
}
if (HeaderDetail?.is_authentication && !user?.userInfo?.authentication) {
dispatch({
type: 'shixunsDetail/setActionTabs',
@ -255,13 +273,7 @@ const competitionDetails: FC<PageProps> = ({
openNewWindow(url)
return;
}
// setisshowmodal(true);
if(!user?.userInfo?.sign_cla){
setVisible(true);
return;
}else{
setisshowmodal(true);
}
setisshowmodal(true);
// if (url === "personal") {
// if (item.enroll_ended === true) {
// //已截止
@ -289,25 +301,25 @@ const competitionDetails: FC<PageProps> = ({
}
}
useEffect(()=>{
if(user?.userInfo?.login){
getId();
}
},[user?.userInfo])
// useEffect(()=>{
// if(user?.userInfo?.login){
// getId();
// }
// },[user?.userInfo])
async function getId() {
let data =await dispatch({
type: 'competitions/GetKylinId',
payload: {
owner:user?.userInfo?.login
}
})
// data.data ||
let a =["009"];
console.log(a);
let filter = a.filter((i:any)=>i === identifier.toString());
console.log(filter && filter.length>0?true:false);
}
// async function getId() {
// let data =await dispatch({
// type: 'competitions/GetKylinId',
// payload: {
// owner:user?.userInfo?.login
// }
// })
// // data.data ||
// let a = data.data;
// console.log(a);
// let filter = a.filter((i:any)=>i === identifier.toString());
// console.log(filter && filter.length>0?true:false);
// }
async function getChartRules() {
await setChartRules(
@ -428,7 +440,7 @@ const competitionDetails: FC<PageProps> = ({
})
if (data && data.status === 0) {
setdatas(data)
// setisopen(true)
setisopen(true)
init()
setIsAddmodel(false);
}else{
@ -494,7 +506,7 @@ async function JoinTeams(name: any) {
}
})
if (data && data.status === 0) {
// setisopen(true)
setisopen(true)
setdatas(data)
setJoin(false);
setIsClick(true);

View File

@ -410,7 +410,7 @@ const competitionDetails: FC<PageProps> = ({
<AuthModel/>
<Modal
open={isshowModal}
visible={isshowModal}
footer={null}
title="报名成功"
centered={true}

View File

@ -121,7 +121,7 @@ const competitionsIndexPage: FC<PageProps> = ({
competitions.listParams.page = current;
dispatch({
type: 'competitions/getList',
payload: { ...competitions.listParams, edu: searchParams.get("edu") },
payload: { ...competitions.listParams},
});
};
@ -207,7 +207,7 @@ const competitionsIndexPage: FC<PageProps> = ({
}
})
if (data && data.status === 0) {
// setisopen(true)
setisopen(true)
setdatas(data)
dispatch({
type: 'competitions/getList',
@ -277,7 +277,7 @@ const competitionsIndexPage: FC<PageProps> = ({
}
})
if (data && data.status === 0) {
// setisopen(true)
setisopen(true)
setdatas(data)
dispatch({
type: 'competitions/getList',
@ -313,20 +313,36 @@ const competitionsIndexPage: FC<PageProps> = ({
/**
*
*/
const onLickSignUpClick = (event: any, item: any) => {
// if(item.teacher_need_phone||item.member_need_phone){
// event.stopPropagation();
// setshowphone(true)
// return
// }
const onLickSignUpClick =async (event: any, item: any) => {
event.stopPropagation();
if (!handleVerify(dispatch)) {
return;
}
if(!user?.userInfo?.sign_cla){
setVisible(true);
return;
let data =await dispatch({
type: 'competitions/GetKylinId',
payload: {
owner:user?.userInfo?.login
}
})
let a =data.data;
let filter = a.filter((i:any)=>i.toString() === item?.id.toString());
let flag = filter && filter.length>0 ? true : false;
if(flag){
if(!user?.userInfo?.sign_cla){
setVisible(true);
return;
}
}else{
if(item.teacher_need_phone||item.member_need_phone){
event.stopPropagation();
setshowphone(true)
return
}
}
if (item.external_url) {
tourl(item.external_url);
} else {

View File

@ -28,7 +28,6 @@ import env from '@/utils/env';
import Styles from './Cla.less';
import Cla from '@/assets/images/competition/cla.png';
const phoneReg = /^1\d{10}$/;
interface PageProps extends ConnectProps {
competitions: CompetitionsModelState;
@ -73,6 +72,16 @@ const AddClamodal: FC<PageProps> = ({
async function getCla(){
await validateFields();
let values = getFieldsValue();
const phoneReg = /^1\d{10}$/;
const emailReg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
if (!phoneReg.test(values?.phoneNumber)) {
message.info('请输入正确的手机号码');
return;
}
if (!emailReg.test(values?.email)) {
message.info('请输入正确的邮箱地址');
return;
}
if(!checkClaFlag && checkCla){
let data = await dispatch({
type: 'competitions/SignCLA',
@ -88,6 +97,7 @@ const AddClamodal: FC<PageProps> = ({
if (data && data.status === 0) {
onOk();
}
onCancel();
}else{
setCheckClaFlag(true);
}

View File

@ -65,7 +65,7 @@ function Addmodal({
const handleGetCode = async () => {
//调用接口 获取该手机号是否被绑定
let data=await Fetch(`/api/users/accounts/${user.userInfo?.login}/valid_phone.json`,{
let data=await Fetch(`/api/users/accounts/${user.eduUserInfo?.login}/valid_phone.json`,{
method: 'get',
params:{
phone
@ -101,7 +101,7 @@ function Addmodal({
}
let data=await Fetch(
`/api/users/accounts/${user?.userInfo?.login}/phone_force_unbind.json`,{
`/api/users/accounts/${user?.eduUserInfo?.login}/phone_force_unbind.json`,{
method: 'POST',
body:{
code:UntieValue,

View File

@ -100,7 +100,7 @@ export async function SignCLA(params: any) {
body: params
});
}
// 签署CLA协议
// 获取CLA竞赛
export async function GetKylinId(params: any) {
return Fetch(`${ENV.FORGE_SERVER}/api/v1/${params?.owner}/openkylin_sign/competitions`, {
method: 'get',

View File

@ -73,21 +73,21 @@ export const GlobalConfig: ConfigProps = {
newBuild: {
// API_SERVER: 'https://data.educoder.net',
API_SERVER: ((() => {
let api = 'https://data.educoder.net'
const domain = document.domain
// let str = document.domain.split(".")
// str[0] = str[0] + "-data";
if (domain === 'kepukehuan.educoder.net') {
api = 'https://kepukehuan-data.educoder.net'
}
let api = 'https://test-data.educoder.net/'
// const domain = document.domain
// // let str = document.domain.split(".")
// // str[0] = str[0] + "-data";
// if (domain === 'kepukehuan.educoder.net') {
// api = 'https://kepukehuan-data.educoder.net'
// }
return api
})()),
SSH_SERVER: "wss://webssh.educoder.net",
REPORT_SERVER: "http://192.168.1.57:3001",
IMG_SERVER: 'https://ali-cdn.educoder.net',
IMG_SERVER: 'https://test-data.educoder.net/',
FORGE: "https://code.educoder.net/",
QQLoginCB: encodeURIComponent("https://www.educoder.net"),
FORGE_SERVER:"https://www.gitlink.org.cn"
FORGE_SERVER:"https://testforgeplus.educoder.cn"
},
// test
newTest: {
@ -100,13 +100,13 @@ export const GlobalConfig: ConfigProps = {
FORGE_SERVER:"https://testforgeplus.trustie.net"
},
test: {
API_SERVER: '',
IMG_SERVER: '',
API_SERVER: 'https://test-data.educoder.net/',
IMG_SERVER: 'https://test-data.educoder.net/',
REPORT_SERVER: "http://192.168.1.57:3001",
FORGE: "http://test-oldweb.educoder.net/",
SSH_SERVER: "wss://pre-webssh.educoder.net",
QQLoginCB: encodeURIComponent("https://test-newweb.educoder.net"),
FORGE_SERVER:"https://testforgeplus.trustie.net"
FORGE_SERVER:"https://testforgeplus.educoder.net"
},
preBuild: {
API_SERVER: 'https://pre-data.educoder.net',
@ -124,7 +124,7 @@ export const GlobalConfig: ConfigProps = {
FORGE: "http://test-oldweb.educoder.net/",
SSH_SERVER: "wss://pre-webssh.educoder.net",
QQLoginCB: encodeURIComponent("https://test-newweb.educoder.net"),
FORGE_SERVER:"https://testforgeplus.trustie.net"
FORGE_SERVER:"https://testforgeplus.educoder.net"
},
build: {
API_SERVER: 'https://data.educoder.net',