feat: 个人信息

This commit is contained in:
秋水浮尘
2023-11-05 23:51:21 +08:00
parent c1093fa556
commit a635d71a3c
16 changed files with 211 additions and 59 deletions

View File

@@ -80,7 +80,7 @@ const CategoryList = ({ primaryCategoryId, categoryList, ...props }) => {
let list = res.data
for (let i = 0; i < list.length; i++) {
list[i].children = await getLabels(list[i].id)
if (i === 0) {
if (i === 0 && list[i].children.length) {
list[i].children[0].active = true
}
}

View File

@@ -65,8 +65,8 @@ export const imgObject = {
'https://img11.360buyimg.com/imagetools/jfs/t1/206213/24/13307/2603/617f4fc4E676d448d/622d5287fbf5a919.png',
dataImg:
'https://img12.360buyimg.com/imagetools/jfs/t1/207558/34/7606/3672/617f4fc4E1ca685fc/3953a92a6072fba4.png',
javaImg:
'../../views/imgs/javaImg.png',
// javaImg:
// '../../views/imgs/javaImg.png',
npmImg: 'https://img11.360buyimg.com/imagetools/jfs/t1/200551/24/15367/3145/617f4fc4Ea153dc2e/b4bbf2de8807f42d.png',
parallelComputingImg:
'https://img14.360buyimg.com/imagetools/jfs/t1/207198/23/7638/3037/617f4fc4E0e20ab9d/40197a6c79c5a33f.png',

View File

@@ -1,5 +1,5 @@
import { message } from 'antd';
import React, { Component, useState, memo } from 'react'
import React, { useState, memo, useEffect } from 'react'
import { useLocation, useNavigate } from 'react-router-dom';
import './index.less'
// 顶部tab
@@ -37,6 +37,16 @@ const TopMenu = () => {
const location = useLocation()
const navigate = useNavigate()
useEffect(() => {
const cur = MENULIST.filter(t => t.route === location.pathname)
if (cur.length) {
setCurrentKey(cur[0].key)
} else {
setCurrentKey('')
}
}, [location.pathname]);
/**
* 切换item
* @param {*} item
@@ -46,6 +56,7 @@ const TopMenu = () => {
if (item.key === "questionBank") {
if (location.pathname === '/question-bank') return
navigate('/question-bank')
setCurrentKey(item.key)
} else {
return message.info("敬请期待")
}