mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
docs: 更新路由文档
This commit is contained in:
@@ -16,34 +16,58 @@ OpenAuth.Pro采用的是标准vue router来管理页面跳转,基础知识请
|
||||
|
||||
|
||||
在有些场景下,不想通过系统的【模块管理】功能添加页面,如登录、注册、帮助中心、站点介绍等,可以在路由表中直接添加。
|
||||
打开`src\router\index.js`,在数组常量`constantRouterMap`中添加自己的路由信息:
|
||||
打开`src\router\modules\home.js`添加自己的路由信息:
|
||||
|
||||
```javascript
|
||||
{
|
||||
path: '/regster',
|
||||
name: 'regster',
|
||||
hidden: true, //是否在左侧导航栏隐藏
|
||||
meta: {
|
||||
title: '仓储中心',
|
||||
icon: 'guide',
|
||||
sortNo: 0
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
name: 'redirect',
|
||||
hidden: true, //是否在左侧导航栏隐藏
|
||||
meta: {
|
||||
title: '外部页面',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'iframe',
|
||||
hidden: true,
|
||||
name: 'iframe',
|
||||
component: IframeView,
|
||||
meta: {
|
||||
title: '外部页面',
|
||||
id: 'iframe',
|
||||
},
|
||||
},
|
||||
component: () => import('@/views/regster/index') //路由对应的页面视图
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
```
|
||||
|
||||
因为注册页面没有登录的用户信息,会被系统的权限体系拦截从而跳转到登录页面。需要添加到白名单中。
|
||||
打开`src\permission.js`,在`whiteList`中加入刚刚的路由信息:
|
||||
上面会添加一个带有layout的页面(即有顶部、左侧导航栏、面包屑等区域),如果不想使用layout,可以参考:
|
||||
|
||||
```javascript
|
||||
{
|
||||
path: '/wmsinboundordertbls/detail/:id',
|
||||
component: DetailWmsInboundOrderTbls,
|
||||
name: 'wmsinboundordertbls',
|
||||
hidden: true,
|
||||
meta: {
|
||||
notauth: true,
|
||||
title: '入库单详情',
|
||||
noCache: true,
|
||||
icon: 'list',
|
||||
}
|
||||
}
|
||||
```
|
||||
这种页面没有顶部、左侧导航栏、面包屑等区域,方便作为组件嵌入到其他页面中。
|
||||
|
||||
部分页面访问的时候,可能没有登录的用户信息,比如:用户注册页面等。会被系统的权限体系拦截从而跳转到登录页面。需要添加到白名单中。
|
||||
打开`src\permission.js`,在`whiteList`中加入刚刚的路由信息:
|
||||
|
||||
```javascript
|
||||
const whiteList = ['/regster', ...] // 不重定向白名单
|
||||
|
||||
```
|
||||
|
||||
添加完成后,启动站点,直接浏览器访问`http://localhost:1803/#/regster`即可:
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -4,7 +4,7 @@ OpenAuth.Pro Vue2版本基于vue2 + element-ui。它使用开源版OpenAuth.Net
|
||||
|
||||
vue2版源代码获取方式:[http://old.openauth.net.cn/question/detail.html?id=a2be2d61-7fcb-4df8-8be2-9f296c22a89c](http://old.openauth.net.cn/question/detail.html?id=a2be2d61-7fcb-4df8-8be2-9f296c22a89c)
|
||||
|
||||
演示地址: [http://demo.openauth.net.cn:1805/](http://demo.openauth.net.cn:1805/)
|
||||
演示地址: [http://demo.openauth.net.cn:1803/](http://demo.openauth.net.cn:1803/)
|
||||
|
||||
## OpenAuth.Net系列教学视频
|
||||
|
||||
@@ -27,7 +27,7 @@ vue2版源代码获取方式:[http://old.openauth.net.cn/question/detail.html?
|
||||
|
||||
#### visual studio code
|
||||
|
||||
下载最新版的vs code,或Cursor、Windsurf、Trae等工具用来作为OpenAuth.Pro的开发工具。
|
||||
下载最新版的vs code,或Cursor、Windsurf、Trae等工具用来作为OpenAuth.Pro Vue2版的开发工具。
|
||||
|
||||
|
||||
## 创建数据库
|
||||
|
Reference in New Issue
Block a user