feat:增加RouteGo,统一路由跳转
This commit is contained in:
@@ -10,7 +10,7 @@ export default defineConfig({
|
||||
hash: true,
|
||||
title: false,
|
||||
history: {
|
||||
type: "browser"
|
||||
type: "hash"
|
||||
},
|
||||
proxy
|
||||
});
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import less from "./index.less";
|
||||
import PageContainer from "@/components/PageContainer";
|
||||
import {useEffect} from "react";
|
||||
import RouteGo from "@/utils/RouteGo";
|
||||
|
||||
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