This commit is contained in:
caishi 2022-04-02 23:25:50 +08:00
parent b3763a0711
commit e0c9ab70b9
9 changed files with 372 additions and 191 deletions

View File

@ -1,149 +1,291 @@
@import '~@/global.less';
.newFooter {
padding: 90px 20px;
display: flex;
justify-content: center;
align-items: flex-start;
background: #242424;
// .newFooter {
// padding: 90px 20px;
// display: flex;
// justify-content: center;
// align-items: flex-start;
// background: #242424;
// min-width: 1200px;
// :global {
// .module-list {
// width: 200px;
// .title {
// font-weight: 400;
// font-size: 16px;
// color: #dddddd;
// margin-bottom: 20px;
// font-weight: 400;
// }
// a {
// display: block;
// color: #bbb;
// line-height: 34px;
// font-weight: 300;
// &:hover {
// color: #fff;
// }
// }
// }
// .module-introduce {
// display: flex;
// flex-direction: column;
// align-items: center;
// width: 290px;
// margin-top: -12px;
// p {
// font-size: 12px;
// color: #bbb;
// line-height: 32px;
// margin-top: 12px;
// font-weight: 300;
// text-align: justify;
// }
// ul {
// display: flex;
// justify-content: space-around;
// padding: 0;
// margin-top: 20px;
// li {
// display: flex;
// flex-direction: column;
// justify-content: center;
// align-items: center;
// span {
// font-size: 12px;
// color: #bbb;
// padding-top: 10px;
// }
// }
// li:first-child {
// margin-right: 50px;
// }
// li:last-child {
// img {
// cursor: pointer;
// &:hover {
// & + span {
// color: #fff;
// }
// }
// }
// span {
// cursor: pointer;
// &:hover {
// color: #fff;
// }
// }
// }
// }
// ol {
// margin-top: 16px;
// display: flex;
// justify-content: space-around;
// padding: 0;
// height: 108px;
// li {
// height: 100%;
// display: flex;
// flex-direction: column;
// justify-content: space-between;
// align-items: center;
// a {
// font-size: 14px;
// color: #bbb;
// margin-top: 20px;
// &:hover {
// color: #fff;
// }
// }
// }
// li:nth-child(2) {
// margin: 0 54px;
// }
// }
// .footer-line {
// width: 310px;
// height: 1px;
// background-color: #3e4042;
// margin: 32px 0;
// }
// section {
// width: 100%;
// height: 115px;
// display: flex;
// flex-direction: column;
// justify-content: space-between;
// align-items: flex-start;
// font-size: 14px;
// color: #bbb;
// font-weight: 300;
// img {
// margin-top: -2px;
// margin-right: 10px;
// }
// }
// }
// }
// }
.newFooter{
position: absolute;
bottom: 0;
width: 100%;
background: #323232;
clear: both;
min-width: 1200px;
:global {
.module-list {
width: 200px;
.title {
font-weight: 400;
font-size: 16px;
color: #dddddd;
margin-bottom: 20px;
font-weight: 400;
z-index: 8;
left: 0;
div[class~='footerInfos']{
display: flex;
max-width: 1200px;
margin: 0 auto;
justify-content: space-around;
padding: 60px 0;
ul {
padding: 0 40px;
box-sizing: border-box;
max-width: 25%;
text-align: left;
li:first-child {
font-size: 17px;
}
a {
display: block;
color: #bbb;
line-height: 34px;
li {
color: #fff;
font-weight: 300;
&:hover {
color: #fff;
}
}
}
.module-introduce {
display: flex;
flex-direction: column;
align-items: center;
width: 290px;
margin-top: -12px;
p {
font-size: 12px;
color: #bbb;
line-height: 32px;
margin-top: 12px;
font-weight: 300;
text-align: justify;
}
ul {
display: flex;
justify-content: space-around;
padding: 0;
margin-top: 20px;
li {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
span {
font-size: 12px;
color: #bbb;
padding-top: 10px;
}
}
li:first-child {
margin-right: 50px;
}
li:last-child {
img {
cursor: pointer;
&:hover {
& + span {
color: #fff;
}
}
}
span {
cursor: pointer;
&:hover {
color: #fff;
}
}
}
}
ol {
margin-top: 16px;
display: flex;
justify-content: space-around;
padding: 0;
height: 108px;
li {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
a {
font-size: 14px;
color: #bbb;
margin-top: 20px;
&:hover {
color: #fff;
}
}
}
li:nth-child(2) {
margin: 0 54px;
}
}
.footer-line {
width: 310px;
height: 1px;
background-color: #3e4042;
margin: 32px 0;
}
section {
width: 100%;
height: 115px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
font-size: 14px;
color: #bbb;
font-weight: 300;
img {
margin-top: -2px;
margin-right: 10px;
list-style: none;
line-height: 28px;
a,span {
color: #bbb;
}
}
}
}
p[class~='footerCopy']{
color: #bbb;
border-top: 1px solid #4e4e4e;
padding: 10px 0;
text-align: center;
margin-bottom: 0px;
a {
color: #bbb;
}
}
}
.footer{
div[class~='newFooter']{
position: absolute;
bottom: 0;
width: 100%;
clear: both;
min-width: 1200px;
z-index: 8;
left: 0;
}
div[class~='footEdition']{
background-color: #171B23;
div[class~='footContent']{
display: flex;
align-items: flex-start;
padding:86px 0px;
justify-content: space-around;
width: 1200px;
margin:0px auto;
ul{
min-width: 120px;
text-align: left;
margin-right: 80px;
padding-left: 0px;
&.center{
text-align: center;
}
&>p{
height: 22px;
font-size: 16px;
font-weight: 400;
color: #FFFFFF;
line-height: 22px;
}
&>img{
width: 100px;
height: 100%;
margin-bottom: 30px;
margin-top: 25px;
border-radius: 10px;
}
li{
height: 20px;
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: #BDC2D1;
list-style-type: none;
margin-bottom: 15px!important;
a{
color: #BDC2D1!important;
&:hover{
text-decoration: underline;
}
}
&.thehead{
height: 25px;
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
line-height: 25px;
margin-bottom: 20px!important;
}
}
.theline{
.imgCon{
width: 90px;
height: 90px;
padding:5px;
border-radius: 4px;
background-color: #fff;
img{
width: 100%;
border-radius: 3px;
}
}
}
}
}
}
p[class~='copyrightDesc']{
font-size: 12px;
font-weight: 400;
color: #BDC2D1;
line-height: 28px;
padding:15px 0px;
text-align: center;
background-color: #1B212C;
margin-bottom: 0px!important;
a{
color: #BDC2D1!important;
}
}
}

View File

@ -75,7 +75,8 @@ const NewFooter: FC<PageProps> = ({ user, globalSetting }) => {
<img src={Code} width={200} height={200} />
</div>
</Modal >
<div className={styles.newFooter} dangerouslySetInnerHTML={{ __html: globalSetting.setting?.footer?.replaceAll("/api/attachments/", ENV.IMG_SERVER + "/api/attachments/") }}></div>
{/* ?.replaceAll("/api/attachments/", ENV.IMG_SERVER + "/api/attachments/") */}
<div className={styles.footer} dangerouslySetInnerHTML={{ __html: globalSetting.setting?.footer }}></div>
{/* <div class={styles.newFooter}>
<aside class="module-list">
<div class="title"></div>

View File

@ -270,7 +270,7 @@ const User: FC<PageProps> = ({
>
<img
className={`${styles.userPic} current ml15`}
src={`${ENV?.IMG_SERVER}/images/${user.userInfo?.image_url}`}
src={`${ENV?.FORGE_SERVER}/images/${user.userInfo?.image_url}`}
alt=""
onClick={() =>
history.push(

View File

@ -25,7 +25,7 @@
.menu {
margin: 0;
padding: 0;
margin-left: 30px;
// margin-left: 30px;
display: flex;
flex-flow: row nowrap;
align-items: center;

View File

@ -250,7 +250,7 @@ const HeaderComponents: FC<PageProps> = ({
}
{
globalSetting.setting?.nav_logo_url &&
<a href={globalSetting.setting?.common?.main_site_url}><img src={ globalSetting.setting?.common?.main_site_url +'/'+ globalSetting.setting?.nav_logo_url} className="mr50"/></a>
<a style={{marginLeft:"78px"}} href={globalSetting.setting?.common?.main_site_url}><img src={ globalSetting.setting?.common?.main_site_url +'/'+ globalSetting.setting?.nav_logo_url} className="mr50"/></a>
}
{!checkIsClientExam() && globalSetting.setting &&
globalSetting.setting.navbar.map(function (
@ -310,7 +310,7 @@ const HeaderComponents: FC<PageProps> = ({
<SearchInput />
{!isLogin && <Join />}
{
!isLogin && !!user?.userInfo?.login && <Link className="iconfont icon-xiaoxilingdang c-white ml15 mr15 font18 relative" to={`/messages/${user?.userInfo?.login}/user_tidings`}>{user?.navigationInfo?.top?.new_message && <span className={styles.newslight}></span>}</Link>
!!user?.userInfo?.login && <a className="iconfont icon-xiaoxilingdang c-white ml15 mr15 font18 relative" href ={`${globalSetting?.setting?.common?.main_site_url}/settings/notice`}>{user?.userInfo?.message_unread_total && <span className={styles.newslight}>{user?.userInfo?.message_unread_total}</span>}</a>
}
</>
}

View File

@ -13,6 +13,8 @@ import {
history,
} from 'umi'
import styles from './index.less';
import { setCookie } from '@/utils/util';
import { await } from 'signale';
const inputStyle = { height: 45, borderRadius: 4 }
interface ILoginForm {
@ -29,52 +31,75 @@ const LoginPopComponents = ({ dispatch,setType,user,setusername,globalSetting }:
const password =/^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
const onFinish = async (values: any) => {
if(!password.test(values.password)){
// const onFinish = async (values: any) => {
// if(!password.test(values.password)){
setusername(values.login)
setErrorValue('系统检测您的密码强度过低,请及时修改')
// return
}
const res = await LoginIn(values)
if (!!res.status) {
setErrorValue(res?.message)
return;
}
if (res?.show) {
localStorage.setItem('extension-modal', 'exist');
localStorage.setItem('extension-date', res?.start_date);
} else {
localStorage.removeItem('extension-modal')
}
console.log(history, 'history')
if (location.pathname === '/user/login' || location.pathname === '/login') {
let from = location.query?.from || location.query?.back_url
if (from) {
window.location.href = decodeURIComponent(from)
} else {
//判断 如果密码强度过低 跳转修改密码页
if(!password.test(values.password)){
message.info('系统检测您的密码强度过低,请及时修改')
window.location.href = '/account/secure'
}else{
window.location.reload()
}
}
} else {
if(!password.test(values.password)){
message.info('系统检测您的密码强度过低,请及时修改')
history.replace('/account/secure?active=3')
dispatch({
type: 'user/showPopLogin',
payload: { showPopLogin: false },
})
}else{
window.location.reload()
}
}
// setusername(values.login)
// setErrorValue('系统检测您的密码强度过低,请及时修改')
// // return
// }
// const res = await LoginIn(values)
// if (!!res.status) {
// setErrorValue(res?.message)
// return;
// }
// if (res?.show) {
// localStorage.setItem('extension-modal', 'exist');
// localStorage.setItem('extension-date', res?.start_date);
// } else {
// localStorage.removeItem('extension-modal')
// }
// console.log(history, 'history')
// if (location.pathname === '/user/login' || location.pathname === '/login') {
// let from = location.query?.from || location.query?.back_url
// if (from) {
// window.location.href = decodeURIComponent(from)
// } else {
// //判断 如果密码强度过低 跳转修改密码页
// if(!password.test(values.password)){
// message.info('系统检测您的密码强度过低,请及时修改')
// window.location.href = '/account/secure'
// }else{
// window.location.reload()
// }
// }
// } else {
// if(!password.test(values.password)){
// message.info('系统检测您的密码强度过低,请及时修改')
// history.replace('/account/secure?active=3')
// dispatch({
// type: 'user/showPopLogin',
// payload: { showPopLogin: false },
// })
// }else{
// window.location.reload()
// }
// }
form.resetFields()
// form.resetFields()
// }
const onFinish = async (values: any) => {
var response =await dispatch({
type: 'user/ForgeLogin',
payload: { ...values ,autologin: values.autologin?1:0 },
})
console.log(response)
if (response.login) {
//判断用户是否选择【下次自动登录】
setCookie('autologin',values.autologin,1);
// const searchParams = new URLSearchParams(search.substring(1));
// const goPage = searchParams.get("go_page");
//意见反馈
dispatch({
type: 'user/showPopLogin',
payload: { showPopLogin: false },
})
window.location.reload();
}
if(response.status && response.status !== 0 ) {
message.info(response.data.message);
}
}
const handleClick = () => {
dispatch({

View File

@ -1,6 +1,6 @@
import { Effect, Reducer, Subscription, history } from 'umi'
import { Action } from '@@/plugin-dva/connect'
import { LoginIn, getUserInfo, getNavigationInfo } from '@/service/user'
import { LoginIn, getUserInfo, getNavigationInfo , ForgeLogin } from '@/service/user'
export interface UserModelState {
name: string
@ -21,6 +21,7 @@ export interface UserModelType {
getUserInfo: Effect
getNavigationInfo: Effect
setActionTabs: Effect;
ForgeLogin:Effect
}
reducers: {
save: Reducer<UserModelState>
@ -69,9 +70,13 @@ const UserModel: UserModelType = {
payload: { showPopLogin: payload.showPopLogin, showClosable: payload.showClosable },
})
},
*ForgeLogin({ payload }, { call, put }) {
const response = yield call(ForgeLogin, { ...payload })
return response;
},
*getUserInfo({ payload }, { call, put }) {
// location.search
const response = yield call(getUserInfo, { ...payload })
const response = yield call(getUserInfo, { ...payload,debug:"admin" })
localStorage.userInfo = JSON.stringify(response);
yield put({

View File

@ -1,4 +1,12 @@
import Fetch from '@/utils/fetch';
import ENV from '@/utils/env';
export async function ForgeLogin(params: any) {
return Fetch(`${ENV.FORGE_SERVER}/api/accounts/login.json`, {
method: 'post',
body: { ...params },
});
}
export async function LoginIn(params: any) {
return Fetch('/api/accounts/login.json', {
method: 'post',

View File

@ -133,7 +133,7 @@ export const GlobalConfig: ConfigProps = {
FORGE: "https://forge.educoder.net/",
SSH_SERVER: "wss://webssh.educoder.net",
QQLoginCB: encodeURIComponent("https://www.educoder.net"),
FORGE_SERVER:"https://testforgeplus.trustie.net"
FORGE_SERVER:"https://gitlink.org.cn"
},
};
export default GlobalConfig[window.ENV || "dev"]