From a93b8a08c9f1304d812f0d54fa811a99e7329e1c Mon Sep 17 00:00:00 2001 From: caishi Date: Thu, 28 Oct 2021 18:23:22 +0800 Subject: [PATCH 1/8] register --- src/modules/login/EducoderLogin.js | 4 +- src/modules/user/LoginRegisterComponent.js | 709 +++++++++++++-------- 2 files changed, 456 insertions(+), 257 deletions(-) diff --git a/src/modules/login/EducoderLogin.js b/src/modules/login/EducoderLogin.js index b4485efee..6cf97a6e8 100644 --- a/src/modules/login/EducoderLogin.js +++ b/src/modules/login/EducoderLogin.js @@ -97,9 +97,9 @@ class EducoderLogin extends Component {
{ mygetHelmetapi && mygetHelmetapi.login_logo_url ? - this.gohome()} width="80px" src={getImageUrl(mygetHelmetapi.login_logo_url)}/> + this.gohome()} src={getImageUrl(mygetHelmetapi.login_logo_url)}/> : - this.gohome()} src={educodernet} width="80px"/> + this.gohome()} src={educodernet}/> }
{ diff --git a/src/modules/user/LoginRegisterComponent.js b/src/modules/user/LoginRegisterComponent.js index 8ccc64b10..a6ba6570e 100644 --- a/src/modules/user/LoginRegisterComponent.js +++ b/src/modules/user/LoginRegisterComponent.js @@ -1,6 +1,6 @@ -import React, { Component } from 'react'; -import { setmiyah, broadcastChannelPostMessage } from 'educoder'; -import { Tabs, Input, Checkbox, Button, notification, Menu } from 'antd'; +import React, {Component} from 'react'; +import {setmiyah,broadcastChannelPostMessage} from 'educoder'; +import {Tabs, Input, Checkbox, Button, notification,Menu} from 'antd'; import passopen from '../../../src/images/login/passopen.png'; import passoff from '../../../src/images/login/passoff.png'; import axios from 'axios'; @@ -12,7 +12,7 @@ import './common.css' import './commontwo.css' const { TabPane } = Tabs; const loginInputsyl = { - "width": "434px", + "width":"434px", "height": "462px", "-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", "box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", @@ -25,48 +25,15 @@ class LoginRegisterComponent extends Component { constructor(props) { super(props) - if (props.loginstatus === true) { - this.state = { - tab: ["0"], - classpass: "text", - // 登录 - passopens: passoff, - seconds: 60, - discodeBtn: false, - clearInterval: false, - autoLogin: true, - classpassbool: false, - // 注册 - readAgreement: false, - getverificationcodes: true, - dragOk: false, - Agreetotheterms: true, - login: "", - password: "", - logins: "", - passwords: "", - codes: "", - Phonenumberisnotco: undefined, - Phonenumberisnotcos: undefined, - Phonenumberisnotcosyzm: undefined, - Phonenumberisnotcosymmm: undefined, - Phonenumberisnotcosytdhk: undefined, - Phonenumberisnotcosyfwtk: undefined, - Phonenumberisnotcodmm: undefined, - Phonenumberisnotcobool: false, - Whethertoverify: false, - pciphone: true, - MyEduCoderModals: false, - registered: undefined, - Phonenumberisnotcodmms: undefined, - weixinlogin: false, - qqlogin: false - } - } - if (props.loginstatus === false) { + + // + // console.log("LoginRegisterComponent"); + // console.log("29"); + // console.log(props.loginstatus); + if(props.loginstatus === true){ // console.log(props.loginstatus); this.state = { - tab: ["1"], + tab:["0"], classpass: "text", // 登录 passopens: passoff, @@ -87,25 +54,64 @@ class LoginRegisterComponent extends Component { codes: "", Phonenumberisnotco: undefined, Phonenumberisnotcos: undefined, - Phonenumberisnotcosyzm: undefined, - Phonenumberisnotcosymmm: undefined, - Phonenumberisnotcosytdhk: undefined, - Phonenumberisnotcosyfwtk: undefined, + Phonenumberisnotcosyzm:undefined, + Phonenumberisnotcosymmm:undefined, + Phonenumberisnotcosytdhk:undefined, + Phonenumberisnotcosyfwtk:undefined, + Phonenumberisnotcodmm:undefined, Phonenumberisnotcobool: false, - Phonenumberisnotcodmm: undefined, - Whethertoverify: false, - pciphone: true, - MyEduCoderModals: false, - registered: undefined, - Phonenumberisnotcodmms: undefined, - weixinlogin: false, - qqlogin: false + Whethertoverify:false, + pciphone:true, + MyEduCoderModals:false, + registered:undefined, + Phonenumberisnotcodmms:undefined, + weixinlogin:false, + qqlogin:false + } + } + if(props.loginstatus === false){ + // console.log(props.loginstatus); + this.state = { + tab:["1"], + classpass: "text", + // 登录 + passopens: passoff, + seconds: 60, + discodeBtn: false, + clearInterval: false, + autoLogin: true, + classpassbool: false, + // 注册 + readAgreement: false, + getverificationcodes: true, + dragOk: false, + Agreetotheterms: true, + login: "", + password: "", + logins: "", + passwords: "", + codes: "", + Phonenumberisnotco: undefined, + Phonenumberisnotcos: undefined, + Phonenumberisnotcosyzm:undefined, + Phonenumberisnotcosymmm:undefined, + Phonenumberisnotcosytdhk:undefined, + Phonenumberisnotcosyfwtk:undefined, + Phonenumberisnotcobool: false, + Phonenumberisnotcodmm:undefined, + Whethertoverify:false, + pciphone:true, + MyEduCoderModals:false, + registered:undefined, + Phonenumberisnotcodmms:undefined, + weixinlogin:false, + qqlogin:false } } } //判断是否是手机端 - IsPC = () => { + IsPC=()=> { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", @@ -119,11 +125,11 @@ class LoginRegisterComponent extends Component { } return flag; } - // 点击表单后,改变type +// 点击表单后,改变type changeType = () => { - this.setState({ classpass: 'password' }); + this.setState({classpass: 'password'}); } - IsPC = () => { + IsPC=()=>{ var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", @@ -138,29 +144,39 @@ class LoginRegisterComponent extends Component { return flag; } componentDidMount = () => { - let flag = this.IsPC(); //true为PC端,false为手机端 - this.setState({ - isphone: flag - }) - let pcipns = this.IsPC(); + let flag = this.IsPC(); //true为PC端,false为手机端 + this.setState({ + isphone:flag + }) + // console.log("componentDidUpdate"); + // console.log(this.props); + let pcipns=this.IsPC(); if (this.props.match.url === "/login") { + // this.state = { + // tab:["0"], + // + // } this.setState({ - tab: ["0"] + tab:["0"] }) } else if (this.props.match.url === "/register") { + // this.state = { + // tab:["1"], + // + // } this.setState({ - tab: ["1"] + tab:["1"] }) } this.setState({ - pciphone: pcipns, + pciphone:pcipns, }) } - openNotification = (messge, type) => { + openNotification = (messge,type) => { // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 notification.open({ message: "提示", @@ -183,6 +199,8 @@ class LoginRegisterComponent extends Component { StudyMakeMoney = () => { // 调用父组件方法 + + // this.props.Setlogins(3); this.setState({ login: "", password: "", @@ -192,7 +210,7 @@ class LoginRegisterComponent extends Component { }); try { this.props.Setshowbool(3); - } catch (e) { + }catch (e) { } } @@ -202,7 +220,7 @@ class LoginRegisterComponent extends Component { // -------------------- LOGIN START //下次自动登入 onAutoLoginChange = (e) => { - this.setState({ autoLogin: e.target.checked }) + this.setState({autoLogin: e.target.checked}) } // -------------------- LOGIN END @@ -231,19 +249,19 @@ class LoginRegisterComponent extends Component { } // -------------------- REGISTER START onReadAgreementChange = (e) => { - this.setState({ readAgreement: e.target.checked }) + this.setState({readAgreement: e.target.checked}) } //是否验证通过 dragOkCallback = () => { this.setState({ - Phonenumberisnotcosytdhk: undefined, + Phonenumberisnotcosytdhk:undefined, }) if (this.state.logins.length === 0) { this.setState({ - Phonenumberisnotcos: "账号不能为空", + Phonenumberisnotcos:"账号不能为空", Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) @@ -261,14 +279,14 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, - dragOk: true, + dragOk:true, }) } else { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, - dragOk: true, + dragOk:true, }); this.Emailphonenumberverification(this.state.logins, 2); return @@ -284,8 +302,8 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: stringdata, Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }); @@ -295,14 +313,14 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, - dragOk: true, + dragOk:true, }) this.Emailphonenumberverification(this.state.logins, 2); return } this.setState({ - Phonenumberisnotcosytdhk: undefined, + Phonenumberisnotcosytdhk:undefined, }) this.Emailphonenumberverification(this.state.logins, 2) @@ -321,12 +339,12 @@ class LoginRegisterComponent extends Component { if (this.state.login === undefined || this.state.login == "") { this.setState({ - Phonenumberisnotco: "账号不能为空", + Phonenumberisnotco:"账号不能为空", }) return } else if (this.state.password === undefined || this.state.password == "") { this.setState({ - Phonenumberisnotcodmm: "密码不能为空", + Phonenumberisnotcodmm:"密码不能为空", }) return } @@ -340,38 +358,38 @@ class LoginRegisterComponent extends Component { return } - if (response.data.status === -2) { - if (response.data.message === "该手机号尚未注册" || response.data.message === "该邮箱尚未注册") { + if(response.data.status === -2){ + if(response.data.message==="该手机号尚未注册" || response.data.message==="该邮箱尚未注册"){ this.setState({ - Phonenumberisnotco: response.data.message, + Phonenumberisnotco:response.data.message, }) return; } - else if (response.data.message === "错误的账号或密码") { + else if(response.data.message==="错误的账号或密码"){ this.setState({ - Phonenumberisnotcodmms: response.data.message, + Phonenumberisnotcodmms:response.data.message, }) return; } - else if (response.data.message === "违反平台使用规范,账号已被锁定") { + else if(response.data.message==="违反平台使用规范,账号已被锁定"){ this.setState({ - Phonenumberisnotco: response.data.message, + Phonenumberisnotco:response.data.message, }) return; } else if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") { const messge = ( -
-

- 登录密码出错已达上限,账号已被锁定; +

+

+ 登录密码出错已达上限,账号已被锁定;

-

- 请10分钟后重新登录或找回密码 -

-
+

+ 请10分钟后重新登录或找回密码 +

+
) this.openNotifications(messge); return; @@ -383,6 +401,11 @@ class LoginRegisterComponent extends Component { } + // if(response.data.profile_completed !== null || response.data.profile_completed === false){ + // this.setMyEduCoderModals(); + // return; + // } + if (response.status === 200) { if (response.data.status === 402) { window.location.href = response.data.url; @@ -392,14 +415,14 @@ class LoginRegisterComponent extends Component { isRender: false }) var weekArray = JSON.parse(window.sessionStorage.getItem('yslgeturls')); - if (weekArray === undefined) { - weekArray = "/"; + if(weekArray===undefined){ + weekArray="/"; } - if (weekArray === null) { - weekArray = "/"; + if(weekArray===null){ + weekArray="/"; } - if (weekArray === "null") { - weekArray = "/"; + if(weekArray==="null"){ + weekArray="/"; } window.location.href = weekArray; } @@ -413,37 +436,74 @@ class LoginRegisterComponent extends Component { } //注册接口 postregistered = () => { - if (this.state.logins === undefined || this.state.logins === "" || this.state.logins.length === 0) { + // if (this.state.logins === undefined || this.state.logins === "") { + // this.openNotification(`请输入登录手机号码或邮箱`,2); + // + // return + // } else if (this.state.dragOk === false) { + // this.openNotification(`请拖动滑块验证`,2); + // return + // } else if (this.state.codes === undefined || this.state.codes == "") { + // this.openNotification(`请输入验证码`,2); + // return + // } else if (this.state.passwords === undefined || this.state.passwords == "") { + // this.openNotification(`请输入密码`,2); + // return + // } else if (this.state.Agreetotheterms === false) { + // this.openNotification(`请同意服务协议条款`,2); + // return; + // } + if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) { this.setState({ - Phonenumberisnotcos: "账号不能为空", + Phonenumberisnotcos:"账号不能为空", Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) return } + if(this.state.pciphone===true){ + if (this.state.dragOk === false) { + // this.openNotification(`请拖动滑块完成验证`,2); + this.setState({ + Phonenumberisnotcosytdhk:"请拖动滑块完成验证", + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return + } + } - if (this.state.passwords === undefined || this.state.passwords == "" || this.state.passwords.length === 0) { + if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { + // this.openNotification(`请输入验证码`,2); this.setState({ - Phonenumberisnotcosymmm: "密码不能为空", + Phonenumberisnotcosyzm:"验证码不能为空", }) return - } else if (this.state.passwords !== undefined && this.state.passwords.length > 0 && this.state.passwords.length < 8) { + } else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) { this.setState({ - Phonenumberisnotcosymmm: "密码不能少于8位", + Phonenumberisnotcosymmm:"密码不能为空", }) return - } else if (this.state.passwords !== undefined && this.state.passwords.length > 0 && this.state.passwords.length > 16) { + } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length<8){ this.setState({ - Phonenumberisnotcosymmm: "密码不能超过16位", + Phonenumberisnotcosymmm:"密码不能少于8位", }) return + } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length>16){ + this.setState({ + Phonenumberisnotcosymmm:"密码不能超过16位", + }) + return + } else if (this.state.Agreetotheterms === false) { + this.openNotification(`请同意服务协议条款`,2); + return; } let url; - if (this.props.weixinlogin) { - url = '/weapps/register.json'; - } else { + if(this.props.weixinlogin){ + url= '/weapps/register.json'; + }else{ url = "/accounts/register.json"; } @@ -452,9 +512,34 @@ class LoginRegisterComponent extends Component { password: this.state.passwords, code: this.state.codes, }).then((result) => { - if (result && result.data) { - this.openNotification("注册成功!"); - this.props.history.push('/'); + if(result){ + if(result.data.status===-2){ + if(result.data.message==="验证码不正确"){ + this.setState({ + Phonenumberisnotcosyzm:"验证码不正确", + }) + + return; + }else if(result.data.message==="验证码已失效"){ + this.setState({ + Phonenumberisnotcosyzm:"验证码不正确", + }) + + return; + }else { + this.openNotification(result.data.message); + return; + } + }else { + // this.setState({ + // logins: "", + // dragOk: false, + // codes: "", + // passwords: "", + // Agreetotheterms: "", + // }) + this.setMyEduCoderModals(); + } } }).catch((error) => { @@ -475,21 +560,21 @@ class LoginRegisterComponent extends Component { // console.log(result); // this.setState({dragOk: true}) - if (result) { - if (result.data.status === -2) { + if(result){ + if(result.data.status===-2){ if (id === 1) { - if (result.data.message === "该手机号码或邮箱已被注册") { + if(result.data.message==="该手机号码或邮箱已被注册"){ this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, - dragOk: true, + dragOk:true, }) - } else { + }else { this.setState({ Phonenumberisnotco: result.data.message, Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) @@ -499,26 +584,26 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: result.data.message, Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) return; } - } else { + }else { if (id === 1) { this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, - dragOk: true, + dragOk:true, }) return; } else if (id === 2) { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, - dragOk: true, + dragOk:true, }) return; } @@ -531,20 +616,20 @@ class LoginRegisterComponent extends Component { }; //短信验证 SMSverification = () => { - let logins = this.state.logins; + let logins=this.state.logins; var url = `/accounts/get_verification_code.json`; axios.get((url), { params: { login: this.state.logins, type: 1, - smscode: setmiyah(logins) + smscode:setmiyah(logins) } }).then((result) => { //验证有问题{"status":1,"message":"success"} // console.log(result); - if (result.data.status === 1) { + if(result.data.status===1){ this.openNotification("验证码已发送,请注意查收"); - } else if (result.data.status === -2) { + }else if(result.data.status===-2){ this.openNotification(result.data.message); } }).catch((error) => { @@ -557,13 +642,13 @@ class LoginRegisterComponent extends Component { if (this.state.classpassbool === true) { this.setState({ - passopens: passoff, + passopens:passoff , classpass: "text", classpassbool: false, }) } else { this.setState({ - passopens: passopen, + passopens: passopen , classpass: "password", classpassbool: true, }) @@ -575,19 +660,19 @@ class LoginRegisterComponent extends Component { getverificationcode = () => { // console.log(this.state.Phonenumberisnotcobool); // console.log(this.state.dragOk); - if (this.state.logins === undefined || this.state.logins.length === 0) { + if(this.state.logins === undefined || this.state.logins.length===0){ this.openNotification("请输入手机号或邮箱"); return; } //这是判断是否手机正确 - if (this.state.Phonenumberisnotcobool === true) { + if(this.state.Phonenumberisnotcobool === true){ this.openNotification(this.state.Phonenumberisnotcos); this.setState({ - Whethertoverify: this.state.Whethertoverify === true ? false : true, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) return; } - if (this.state.pciphone === true) { + if(this.state.pciphone===true) { if (this.state.dragOk === false) { this.openNotification("请拖动滑块验证"); return; @@ -639,25 +724,25 @@ class LoginRegisterComponent extends Component { loginInputonChange = (e) => { // console.log(e.target.value); var stirngt; - if (e.target.value.length > 0) { - var str = e.target.value.replace(/\s*/g, "") - stirngt = str; - } else { - stirngt = e.target.value; + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; } if (e.target.value.length === 0) { this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, - Phonenumberisnotcodmms: undefined, + Phonenumberisnotcodmms:undefined, login: stirngt, }) - } else { + }else{ this.setState({ login: stirngt, - Phonenumberisnotco: undefined, - Phonenumberisnotcodmms: undefined, + Phonenumberisnotco:undefined, + Phonenumberisnotcodmms:undefined, }) } @@ -674,17 +759,20 @@ class LoginRegisterComponent extends Component { }) return; } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 var stringdata = undefined; if (!regph.test(e.target.value)) { stringdata = "手机号格式不正确"; this.setState({ Phonenumberisnotcos: stringdata, Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) } else { this.setState({ @@ -705,8 +793,8 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: stringdata, Phonenumberisnotcobool: true, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) return } else { @@ -722,43 +810,47 @@ class LoginRegisterComponent extends Component { } //获取登入密码 passwordonChange = (e) => { + // console.log(e.target.value); var stirngt; - if (e.target.value.length > 0) { - var str = e.target.value.replace(/\s*/g, "") - stirngt = str; - } else { - stirngt = e.target.value; + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; } this.setState({ password: stirngt, - Phonenumberisnotcodmm: undefined, - Phonenumberisnotcodmms: undefined, + Phonenumberisnotcodmm:undefined, + Phonenumberisnotcodmms:undefined, }) + // this.setState({ + // password: e.target.value + // }) } //获取注册登入 loginInputonChanges = (e) => { var stirngt; - if (e.target.value.length > 0) { - var str = e.target.value.replace(/\s*/g, "") - stirngt = str; - } else { - stirngt = e.target.value; + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; } if (e.target.value.length === 0) { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, logins: stirngt, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) - } else { + }else{ this.setState({ logins: stirngt, Phonenumberisnotcos: undefined, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) } @@ -767,81 +859,186 @@ class LoginRegisterComponent extends Component { passwordonChanges = (e) => { // console.log(e.target.value); var stirngt; - if (e.target.value.length > 0) { - var str = e.target.value.replace(/\s*/g, "") - stirngt = str; - } else { - stirngt = e.target.value; + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; } this.setState({ passwords: stirngt, - Phonenumberisnotcosymmm: undefined, + Phonenumberisnotcosymmm:undefined, }) } //获取code codesonChange = (e) => { this.setState({ codes: e.target.value, - Phonenumberisnotcosyzm: undefined, + Phonenumberisnotcosyzm:undefined, }) } //切换tab - changeTab = (e) => { + changeTab=(e)=>{ this.setState({ - tab: e.key + tab:e.key }) - if (e.key === 0) { + + if(e.key === 0){ this.setState({ - Phonenumberisnotcos: undefined + Phonenumberisnotcos:undefined }) - } else { + }else{ this.setState({ - Phonenumberisnotco: undefined + Phonenumberisnotco:undefined }) + } + + // this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key) + } - setMyEduCoderModals = () => { + loginonkeyup =(e)=>{ + if(e.keyCode==32){ + + return false; + } + }; + setNotcompleteds=()=>{ this.setState({ - MyEduCoderModals: true, - registered: "注册成功" + Notcompleteds:true, + MyEduCoderModals:false, + registered:undefined, + + }) + }; + setMyEduCoderModals=()=>{ + this.setState({ + MyEduCoderModals:true, + registered:"注册成功" }) }; + openweixinlogin=()=>{ + this.setState({ + weixinlogin:true + }) + } + hideweixinlogin=()=>{ + this.setState({ + weixinlogin:false, + qqlogin:false, + tab:["0"] + }) + } + + openqqlogin=()=>{ + this.setState({ + qqlogin:true + }) + //window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code` + window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` + // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` + } + + openphoneqqlogin=()=>{ + window.open( + `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` + ) + } render() { - const {passopens,Agreetotheterms,Phonenumberisnotcos,tab,classpassbool,Phonenumberisnotcosymmm} = this.state + const { + // 登录 + autoLogin, + classpass, + passopens, + seconds, + getverificationcodes, + Agreetotheterms, + Phonenumberisnotco, + Phonenumberisnotcos, + codes, + tab, + dragOk, + Whethertoverify, + classpassbool, + Phonenumberisnotcosytdhk, + Phonenumberisnotcosyzm, + Phonenumberisnotcosymmm, + Phonenumberisnotcodmm, + // 注册 + readAgreement, + pciphone, + Phonenumberisnotcodmms, + weixinlogin + } = this.state + // height: 346px; + if (this.state.seconds === 0) { + // window.location.href='http://www.cnblogs.com/a-cat/'; + } + + return ( -
- + } + -
- - 注册 - - -
- - { - Phonenumberisnotcos && Phonenumberisnotcos !== "" ? -

- {Phonenumberisnotcos} -

- :
+
+ {weixinlogin===false&&this.props.weixinlogin===undefined? + 登录 + 注册 + :""} - } + { + weixinlogin===false&&parseInt(tab[0])==0 && +
+

+ } { - weixinlogin===false&&parseInt(tab[0])==1 && + weixinlogin===false&&parseInt(tab[0])==1 &&
- this.Showandhide(key)}> - - }> - { - Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ? -

- {Phonenumberisnotcosymmm} + } + ` + } + + this.Showandhide(key)}> + + }> + { + Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ? +

+ {Phonenumberisnotcosymmm}

:
} - {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?我已阅读并同意 - - 《服务协议条款》 - :""} + + 《服务协议条款》 + :""} @@ -1063,15 +1261,15 @@ class LoginRegisterComponent extends Component { - {weixinlogin===true?:""} - {weixinlogin===true?

- this.hideweixinlogin()}>返回登录注册 -

:""} + {weixinlogin===true?:""} + {weixinlogin===true?

+ this.hideweixinlogin()}>返回登录注册 +

:""}
@@ -1080,3 +1278,4 @@ class LoginRegisterComponent extends Component { } export default (LoginRegisterComponent); + From 015296e0658b940035ca45147be5006ad438cdd9 Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 29 Oct 2021 09:39:59 +0800 Subject: [PATCH 2/8] =?UTF-8?q?merge=20gitlink=E9=A6=96=E9=A1=B5=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A6=96=E9=A1=B5=EF=BC=8Cupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 826 +++++++++++++------------- src/forge/Head/Footer.jsx | 4 +- src/forge/Index.js | 6 - src/forge/Main/projecthome/Index.scss | 4 +- 4 files changed, 418 insertions(+), 422 deletions(-) diff --git a/src/App.js b/src/App.js index 50808276b..61d0e761c 100644 --- a/src/App.js +++ b/src/App.js @@ -3,9 +3,9 @@ import './App.css'; import { ConfigProvider } from 'antd' import zhCN from 'antd/lib/locale-provider/zh_CN'; import { - // BrowserRouter as Router, - Route, - Switch + // BrowserRouter as Router, + Route, + Switch } from 'react-router-dom'; import axios from 'axios'; import LoginDialog from './modules/login/LoginDialog'; @@ -26,18 +26,18 @@ import configureStore from './redux/stores/configureStore'; const store = configureStore(); window.marked = marked; const theme = createMuiTheme({ - palette: { - primary: { - main: '#4CACFF', - contrastText: 'rgba(255, 255, 255, 0.87)' - }, - secondary: { main: '#4CACFF' }, // #11cb5f This is just green.A700 as hex. - }, + palette: { + primary: { + main: '#4CACFF', + contrastText: 'rgba(255, 255, 255, 0.87)' + }, + secondary: { main: '#4CACFF' }, // #11cb5f This is just green.A700 as hex. + }, }); //forge项目 const Projects = Loadable({ - loader: () => import('./forge/Index'), - loading: Loading, + loader: () => import('./forge/Index'), + loading: Loading, }) // forge项目详情 const ProjectDetail = Loadable({ @@ -46,55 +46,55 @@ const ProjectDetail = Loadable({ }); //forge安全设置 const Security = Loadable({ - loader: () => import('./forge/SecuritySetting/Index'), - loading: Loading, + loader: () => import('./forge/SecuritySetting/Index'), + loading: Loading, }) //forge项目-devOps详情 const OpsDetail = Loadable({ - loader: () => import('./forge/DevOps/opsDetail'), - loading: Loading, + loader: () => import('./forge/DevOps/opsDetail'), + loading: Loading, }) //403页面 const Shixunauthority = Loadable({ - loader: () => import('./modules/403/Shixunauthority'), - loading: Loading, + loader: () => import('./modules/403/Shixunauthority'), + loading: Loading, }) //404页面 const Shixunnopage = Loadable({ - loader: () => import('./modules/404/Shixunnopage'), - loading: Loading, + loader: () => import('./modules/404/Shixunnopage'), + loading: Loading, }) //500页面 const http500 = Loadable({ - loader: () => import('./modules/500/http500'), - loading: Loading, + loader: () => import('./modules/500/http500'), + loading: Loading, }) const InfosIndex = Loadable({ - loader: () => import('./forge/users/Index'), - loading: Loading, + loader: () => import('./forge/users/Index'), + loading: Loading, }) // 组织 const OrganizeIndex = Loadable({ - loader: () => import('./forge/Team/Index'), - loading: Loading, + loader: () => import('./forge/Team/Index'), + loading: Loading, }) const EducoderLogin = Loadable({ - loader: () => import('./modules/login/EducoderLogin'), - loading: Loading, + loader: () => import('./modules/login/EducoderLogin'), + loading: Loading, }) const Search = Loadable({ - loader: () => import('./modules/search/'), - loading: Loading, + loader: () => import('./modules/search/'), + loading: Loading, }) const WikiPreview = Loadable({ - loader: () => import('./forge/Wiki/Preview'), - loading: Loading, + loader: () => import('./forge/Wiki/Preview'), + loading: Loading, }) const ProjectIndex = Loadable({ - loader: () => import("./forge/Index"), - loading: Loading, + loader: () => import("./forge/Index"), + loading: Loading, }); const Home = Loadable({ @@ -110,411 +110,411 @@ const Home = Loadable({ const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize"]; class App extends Component { - constructor(props) { - super(props); - this.state = { - Addcoursestype: false, - Addcoursestypes: false, - mydisplay: false, - occupation: 0, - mygetHelmetapi: null, - pathType: null, - pathName: null, - } - } + constructor(props) { + super(props); + this.state = { + Addcoursestype: false, + Addcoursestypes: false, + mydisplay: false, + occupation: 0, + mygetHelmetapi: null, + pathType: null, + pathName: null, + } + } - UNSAFE_componentWillMount() { - initAxiosInterceptors(this.props); - let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : ''; - pathname && this.getPathnameType(pathname); + UNSAFE_componentWillMount() { + initAxiosInterceptors(this.props); + let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : ''; + pathname && this.getPathnameType(pathname); - // 添加路由监听,决定组织还是个人 - this.unlisten = this.props.history.listen((location) => { - let newPathname = location.pathname.split('/')[1]; - if (this.state.pathName !== newPathname) { - // this.setState({ pathType: '' }); - newPathname && this.getPathnameType(newPathname); - } - }); - } + // 添加路由监听,决定组织还是个人 + this.unlisten = this.props.history.listen((location) => { + let newPathname = location.pathname.split('/')[1]; + if (this.state.pathName !== newPathname) { + // this.setState({ pathType: '' }); + newPathname && this.getPathnameType(newPathname); + } + }); + } - shouldComponentUpdate(nextProps, nextState) { - // (!keyWord.includes(this.props.location.pathname.split('/')[1])) && - if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) { - return false; - } else { - return true; - } - } + shouldComponentUpdate(nextProps, nextState) { + // (!keyWord.includes(this.props.location.pathname.split('/')[1])) && + if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) { + return false; + } else { + return true; + } + } - getPathnameType = (pathname) => { - if (!keyWord.includes(pathname)) { - let url = `/owners/${pathname}.json`; - axios.get(url).then((response) => { - if (response && response.status === 200) { - this.setState({ - pathType: response.data.type || '404', - pathName: pathname, - }) - } - }); - }else{ - this.setState({ - pathType: pathname, - pathName: pathname, - }); - } - } + getPathnameType = (pathname) => { + if (!keyWord.includes(pathname)) { + let url = `/owners/${pathname}.json`; + axios.get(url).then((response) => { + if (response && response.status === 200) { + this.setState({ + pathType: response.data.type || '404', + pathName: pathname, + }) + } + }); + }else{ + this.setState({ + pathType: pathname, + pathName: pathname, + }); + } + } - HideAddcoursestypess = (i) => { - this.setState({ - Addcoursestype: false, - Addcoursestypes: false, - mydisplay: true, - occupation: i, - }) - }; - hideAddcoursestypes = () => { - this.setState({ - Addcoursestypes: false - }) - }; + HideAddcoursestypess = (i) => { + this.setState({ + Addcoursestype: false, + Addcoursestypes: false, + mydisplay: true, + occupation: i, + }) + }; + hideAddcoursestypes = () => { + this.setState({ + Addcoursestypes: false + }) + }; - componentDidMount() { - document.title = "loading..."; + componentDidMount() { + document.title = "loading..."; - this.getAppdata(); + this.getAppdata(); - window.addEventListener('error', (event) => { - const msg = `${event.type}: ${event.message}`; - }); + window.addEventListener('error', (event) => { + const msg = `${event.type}: ${event.message}`; + }); - } + } - componentWillUnmount() { - this.unlisten && this.unlisten(); // 执行解绑 - } + componentWillUnmount() { + this.unlisten && this.unlisten(); // 执行解绑 + } - //修改登录方法 - Modifyloginvalue = () => { - this.setState({ - isRender: false, - }) - }; + //修改登录方法 + Modifyloginvalue = () => { + this.setState({ + isRender: false, + }) + }; - //获取数据为空的时候 - gettablogourlnull = () => { - this.setState({ - mygetHelmetapi: undefined - }); - document.title = "Forge"; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = "/react/build/./favicon.ico"; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - }; + //获取数据为空的时候 + gettablogourlnull = () => { + this.setState({ + mygetHelmetapi: undefined + }); + document.title = "Forge"; + var link = document.createElement('link'), + oldLink = document.getElementById('dynamic-favicon'); + link.id = 'dynamic-favicon'; + link.rel = 'shortcut icon'; + link.href = "/react/build/./favicon.ico"; + if (oldLink) { + document.head.removeChild(oldLink); + } + document.head.appendChild(link); + }; - //获取数据的时候 - gettablogourldata = (response) => { - document.title = response.data.setting.name; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = '/' + response.data.setting.tab_logo_url; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - } - //获取当前定制信息 - getAppdata = () => { - let url = "/setting.json"; - axios.get(url).then((response) => { - if (response) { - if (response.data) { - this.setState({ - mygetHelmetapi: response.data.setting - }); - //存储配置到游览器 - localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse', JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } - } else { - this.gettablogourlnull(); - } - } else { - this.gettablogourlnull(); - } - }).catch((error) => { - this.gettablogourlnull(); - }); - }; + //获取数据的时候 + gettablogourldata = (response) => { + document.title = response.data.setting.name; + var link = document.createElement('link'), + oldLink = document.getElementById('dynamic-favicon'); + link.id = 'dynamic-favicon'; + link.rel = 'shortcut icon'; + link.href = '/' + response.data.setting.tab_logo_url; + if (oldLink) { + document.head.removeChild(oldLink); + } + document.head.appendChild(link); + } + //获取当前定制信息 + getAppdata = () => { + let url = "/setting.json"; + axios.get(url).then((response) => { + if (response) { + if (response.data) { + this.setState({ + mygetHelmetapi: response.data.setting + }); + //存储配置到游览器 + localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); + localStorage.setItem('chromesettingresponse', JSON.stringify(response)); + try { + if (response.data.setting.tab_logo_url) { + this.gettablogourldata(response); + } else { + this.gettablogourlnull(); + } + } catch (e) { + this.gettablogourlnull(); + } + } else { + this.gettablogourlnull(); + } + } else { + this.gettablogourlnull(); + } + }).catch((error) => { + this.gettablogourlnull(); + }); + }; - render() { - const { mygetHelmetapi, pathType} = this.state; - let personal = mygetHelmetapi && mygetHelmetapi.personal; - return ( - - - - this.Modifyloginvalue()}> - - {/* */} - - {/* wiki预览 */} - { - return () - } - } /> + render() { + const { mygetHelmetapi, pathType} = this.state; + let personal = mygetHelmetapi && mygetHelmetapi.personal; + return ( + + + + this.Modifyloginvalue()}> + + {/* */} + + {/* wiki预览 */} + { + return () + } + } /> - {/* 项目PR */} - () - } - > + {/* 项目PR */} + () + } + > - {/*项目*/} - { - return () - } - }> - - { - return () - } - }> - + {/*项目*/} + { + return () + } + }> + + { + return () + } + }> + - { - return () - } - } - /> - {/*403*/} - + { + return () + } + } + /> + {/*403*/} + - + - {/*404*/} - + {/*404*/} + - {/* 查询 */} - + {/* 查询 */} + - ( - - ) - } - /> - ( - - ) - } - /> + ( + + ) + } + /> + ( + + ) + } + /> + + {/* 组织 */} + { + return () + } + }> + + + {/*新建项目等*/} + { + return () + } + }> + + + {/* 判断为用户/组织,并进入对应页面 */} + { + pathType === 'User' ? + { + return () + } + } + /> : pathType === 'Organization' ? { + return () + } + }> + : pathType === '404' ? : + "" + } + ( + + ) + } + /> + + {/* 个人主页 */} + { + return () + } + }> - {/* 组织 */} - { - return () - } - }> - - - {/*新建项目等*/} - { - return () - } - }> - - - {/* 判断为用户/组织,并进入对应页面 */} - { - pathType === 'User' ? - { - return () - } - } - /> : pathType === 'Organization' ? { - return () - } - }> - : pathType === '404' ? : - "" - } - ( - - ) - } - /> - - {/* 个人主页 */} - { - return () - } - }> - - - - - {/* */} - - - - ); - } + + + {/* */} + + + + ); + } } // moment国际化,设置为中文 moment.defineLocale('zh-cn', { - months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), - weekdaysMin: '日_一_二_三_四_五_六'.split('_'), - longDateFormat: { - LT: 'Ah点mm分', - LTS: 'Ah点m分s秒', - L: 'YYYY-MM-DD', - LL: 'YYYY年MMMD日', - LLL: 'YYYY年MMMD日Ah点mm分', - LLLL: 'YYYY年MMMD日ddddAh点mm分', - l: 'YYYY-MM-DD', - ll: 'YYYY年MMMD日', - lll: 'YYYY年MMMD日Ah点mm分', - llll: 'YYYY年MMMD日ddddAh点mm分' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || - meridiem === '上午') { - return hour; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } else { - // '中午' - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar: { - sameDay: function () { - return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; - }, - nextDay: function () { - return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; - }, - lastDay: function () { - return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; - }, - nextWeek: function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - lastWeek: function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - sameElse: 'LL' - }, - ordinalParse: /\d{1,2}(日|月|周)/, - ordinal: function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - case 'M': - return number + '月'; - case 'w': - case 'W': - return number + '周'; - default: - return number; - } - }, - relativeTime: { - future: '%s内', - past: '%s前', - s: '几秒', - m: '1分钟', - mm: '%d分钟', - h: '1小时', - hh: '%d小时', - d: '1天', - dd: '%d天', - M: '1个月', - MM: '%d个月', - y: '1年', - yy: '%d年' - }, - week: { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } + months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), + weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), + weekdaysMin: '日_一_二_三_四_五_六'.split('_'), + longDateFormat: { + LT: 'Ah点mm分', + LTS: 'Ah点m分s秒', + L: 'YYYY-MM-DD', + LL: 'YYYY年MMMD日', + LLL: 'YYYY年MMMD日Ah点mm分', + LLLL: 'YYYY年MMMD日ddddAh点mm分', + l: 'YYYY-MM-DD', + ll: 'YYYY年MMMD日', + lll: 'YYYY年MMMD日Ah点mm分', + llll: 'YYYY年MMMD日ddddAh点mm分' + }, + meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, + meridiemHour: function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === '凌晨' || meridiem === '早上' || + meridiem === '上午') { + return hour; + } else if (meridiem === '下午' || meridiem === '晚上') { + return hour + 12; + } else { + // '中午' + return hour >= 11 ? hour : hour + 12; + } + }, + meridiem: function (hour, minute, isLower) { + var hm = hour * 100 + minute; + if (hm < 600) { + return '凌晨'; + } else if (hm < 900) { + return '早上'; + } else if (hm < 1130) { + return '上午'; + } else if (hm < 1230) { + return '中午'; + } else if (hm < 1800) { + return '下午'; + } else { + return '晚上'; + } + }, + calendar: { + sameDay: function () { + return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; + }, + nextDay: function () { + return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; + }, + lastDay: function () { + return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; + }, + nextWeek: function () { + var startOfWeek, prefix; + startOfWeek = moment().startOf('week'); + prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; + return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; + }, + lastWeek: function () { + var startOfWeek, prefix; + startOfWeek = moment().startOf('week'); + prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; + return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; + }, + sameElse: 'LL' + }, + ordinalParse: /\d{1,2}(日|月|周)/, + ordinal: function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + case 'M': + return number + '月'; + case 'w': + case 'W': + return number + '周'; + default: + return number; + } + }, + relativeTime: { + future: '%s内', + past: '%s前', + s: '几秒', + m: '1分钟', + mm: '%d分钟', + h: '1小时', + hh: '%d小时', + d: '1天', + dd: '%d天', + M: '1个月', + MM: '%d个月', + y: '1年', + yy: '%d年' + }, + week: { + // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + } }); export default SnackbarHOC()(App); + diff --git a/src/forge/Head/Footer.jsx b/src/forge/Head/Footer.jsx index f1d0c4709..d9946716e 100644 --- a/src/forge/Head/Footer.jsx +++ b/src/forge/Head/Footer.jsx @@ -18,7 +18,9 @@ function Footer(){ } return( - value && showhtml(value) +
+ {value && showhtml(value)} +
// {/*
//
//