feat:增加RouteGo,统一路由跳转
This commit is contained in:
@@ -10,7 +10,7 @@ export default defineConfig({
|
|||||||
hash: true,
|
hash: true,
|
||||||
title: false,
|
title: false,
|
||||||
history: {
|
history: {
|
||||||
type: "browser"
|
type: "hash"
|
||||||
},
|
},
|
||||||
proxy
|
proxy
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import less from "./index.less";
|
|
||||||
import PageContainer from "@/components/PageContainer";
|
import PageContainer from "@/components/PageContainer";
|
||||||
|
import {useEffect} from "react";
|
||||||
|
import RouteGo from "@/utils/RouteGo";
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
RouteGo.XYM.index();
|
||||||
|
}, [1])
|
||||||
|
|
||||||
return <PageContainer title={"浙科校园码"} loading={false}>
|
///////////////////////////////////////// 页面渲染
|
||||||
<h1 className={less.title}>Page index</h1>
|
|
||||||
</PageContainer>
|
return <PageContainer title={"浙江科技学院"} loading/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
.title {
|
|
||||||
background: rgb(121, 242, 157);
|
|
||||||
}
|
|
||||||
13
src/pages/xym/index.jsx
Normal file
13
src/pages/xym/index.jsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import PageContainer from "@/components/PageContainer";
|
||||||
|
import {useEffect} from "react";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
}, [1])
|
||||||
|
|
||||||
|
///////////////////////////////////////// 页面渲染
|
||||||
|
|
||||||
|
return <PageContainer title={"校园码"} loading/>
|
||||||
|
}
|
||||||
13
src/pages/xym/person.jsx
Normal file
13
src/pages/xym/person.jsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import PageContainer from "@/components/PageContainer";
|
||||||
|
import {useEffect} from "react";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
}, [1])
|
||||||
|
|
||||||
|
///////////////////////////////////////// 页面渲染
|
||||||
|
|
||||||
|
return <PageContainer title={"个人信息"} loading/>
|
||||||
|
}
|
||||||
38
src/utils/RouteGo.js
Normal file
38
src/utils/RouteGo.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import {history} from "umi";
|
||||||
|
|
||||||
|
|
||||||
|
const XYM = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校园码首页
|
||||||
|
*/
|
||||||
|
index: () => {
|
||||||
|
history.push("/xym")
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人信息
|
||||||
|
*/
|
||||||
|
person: () => {
|
||||||
|
history.push("/xym/person")
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回上一页
|
||||||
|
* page 返回多少页,默认-1页
|
||||||
|
* @param page
|
||||||
|
*/
|
||||||
|
goBack: (page = -1) => {
|
||||||
|
history.go(page);
|
||||||
|
},
|
||||||
|
|
||||||
|
XYM,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user