diff --git a/.env.development b/.env.development
index 2922f76..9a917d3 100644
--- a/.env.development
+++ b/.env.development
@@ -6,7 +6,7 @@ VITE_APP_BASE_API = '/'
# /test/sh0001/api
# 线上接口地址
-VITE_APP_API_URL = 'https://cloud.52zaisheng.cn'
+VITE_APP_API_URL = 'https://ifanda.52zaisheng.cn/dy'
# 开发接口地址
# VITE_APP_API_URL = http://localhost:8989
diff --git a/src/json/menus copy.json b/src/json/menus copy.json
deleted file mode 100644
index ecc80bc..0000000
--- a/src/json/menus copy.json
+++ /dev/null
@@ -1,870 +0,0 @@
-[
- {
- "path": "/self/receive-core",
- "component": "Layout",
- "name": "/receive-core",
- "meta": {
- "title": "收货入库",
- "icon": "el-icon-operation",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "receive-pricing",
- "component": "self/receive-core/pricing",
- "name": "receive-pricing",
- "meta": {
- "title": "待定价",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 0
- }
- }
- },
- {
- "path": "receive-waiting-tare",
- "component": "self/receive-core/pricing",
- "name": "receive-waiting-tare",
- "meta": {
- "title": "待过皮重",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 1
- }
- }
- },
- {
- "path": "receive-review",
- "component": "self/receive-core/pricing",
- "name": "receive-review",
- "meta": {
- "title": "待审核",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 2
- }
- }
- },
- {
- "path": "receive-waiting-pay",
- "component": "self/receive-core/pricing",
- "name": "receive-waiting-pay",
- "meta": {
- "title": "待付款",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 3
- }
- }
- },
- {
- "path": "receive-pay",
- "component": "self/receive-core/pricing",
- "name": "receive-pay",
- "meta": {
- "title": "已付款",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 4
- }
- }
- },
- {
- "path": "receive-spl",
- "component": "self/receive-core/receive-spl",
- "name": "receive-spl",
- "meta": {
- "title": "收货补单",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/self/shipment-core",
- "component": "Layout",
- "name": "/shipment-core",
- "meta": {
- "title": "出货销售",
- "icon": "el-icon-operation",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "shipmenting",
- "component": "self/shipment-core/shipmenting",
- "name": "shipmenting",
- "meta": {
- "title": "待出货",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 0
- }
- }
- },
- {
- "path": "shipment-gross",
- "component": "self/shipment-core/shipmenting",
- "name": "shipment-gross",
- "meta": {
- "title": "待过毛重",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 1
- }
- }
- },
- {
- "path": "shipment-settlement",
- "component": "self/shipment-core/shipmenting",
- "name": "shipment-settlement",
- "meta": {
- "title": "待结算",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 2
- }
- }
- },
- {
- "path": "shipment-payment",
- "component": "self/shipment-core/shipmenting",
- "name": "shipment-payment",
- "meta": {
- "title": "待收款",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 3
- }
- }
- },
- {
- "path": "shipment-paied",
- "component": "self/shipment-core/shipmenting",
- "name": "shipment-paied",
- "meta": {
- "title": "已收款",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "scaleStatus": 4
- }
- }
- },
- {
- "path": "shipment-spl",
- "component": "self/shipment-core/shipment-spl",
- "name": "shipment-spl",
- "meta": {
- "title": "出货补单",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/self/receive-data",
- "component": "Layout",
- "name": "/receive-data",
- "meta": {
- "title": "收货数据",
- "icon": "el-icon-operation",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "receive-detail",
- "component": "self/receive-data/receive-detail",
- "name": "receive-detail",
- "meta": {
- "title": "收货明细",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "receive-summary",
- "component": "self/receive-data/receive-summary",
- "name": "receive-summary",
- "meta": {
- "title": "收货汇总",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "receive-cancel",
- "component": "self/receive-data/receive-cancel",
- "name": "receive-cancel",
- "meta": {
- "title": "收货作废",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "supplier-rank",
- "component": "self/receive-data/supplier-rank",
- "name": "supplier-rank",
- "meta": {
- "title": "供应商排行",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/self/shipment-data",
- "component": "Layout",
- "name": "/shipment-data",
- "meta": {
- "title": "出货数据",
- "icon": "el-icon-operation",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "shipment-detail",
- "component": "self/shipment-data/shipment-detail",
- "name": "shipment-detail",
- "meta": {
- "title": "出货明细",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "shipment-summary",
- "component": "self/shipment-data/shipment-summary",
- "name": "shipment-summary",
- "meta": {
- "title": "出货汇总",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "shipment-cancel",
- "component": "self/shipment-data/shipment-cancel",
- "name": "shipment-cancel",
- "meta": {
- "title": "出货作废",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "customer-rank",
- "component": "self/shipment-data/customer-rank",
- "name": "customer-rank",
- "meta": {
- "title": "客户排行",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/self/my-account",
- "component": "Layout",
- "name": "/my-account",
- "meta": {
- "title": "我的账本",
- "icon": "el-icon-operation",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "business-overview",
- "component": "self/my-account/business-overview",
- "name": "business-overview",
- "meta": {
- "title": "经营概况",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "supplier-reconciliation",
- "component": "self/my-account/supplier-reconciliation",
- "name": "supplier-reconciliation",
- "meta": {
- "title": "供应商对账",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "customer-reconciliation",
- "component": "self/my-account/customer-reconciliation",
- "name": "customer-reconciliation",
- "meta": {
- "title": "客户对账",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "payment-details",
- "component": "self/my-account/payment-details",
- "name": "payment-details",
- "meta": {
- "title": "付款明细",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "collection-details",
- "component": "self/my-account/collection-details",
- "name": "collection-details",
- "meta": {
- "title": "收款明细",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/self/params-mgt",
- "component": "Layout",
- "name": "/params-mgt",
- "meta": {
- "title": "参数管理",
- "icon": "el-icon-operation",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "receive-type",
- "component": "self/params-mgt/receive-type",
- "name": "receive-type",
- "meta": {
- "title": "收货分类",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "receive-product",
- "component": "self/params-mgt/receive-product",
- "name": "receive-product",
- "meta": {
- "title": "收货产品",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "shipment-type",
- "component": "self/params-mgt/shipment-type",
- "name": "shipment-type",
- "meta": {
- "title": "出货分类",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "shipment-product",
- "component": "self/params-mgt/shipment-product",
- "name": "shipment-product",
- "meta": {
- "title": "出货产品",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "supplier-type",
- "component": "self/params-mgt/supplier-type",
- "name": "supplier-type",
- "meta": {
- "title": "供应商分类",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "supplier-mgt",
- "component": "self/params-mgt/supplier-mgt",
- "name": "supplier-mgt",
- "meta": {
- "title": "供应商管理",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "customer-mgt",
- "component": "self/params-mgt/customer-mgt",
- "name": "customer-mgt",
- "meta": {
- "title": "客户管理",
- "icon": "el-icon-user",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "stock-card-mgt",
- "component": "self/params-mgt/stock-card-mgt",
- "name": "stock-card-mgt",
- "meta": {
- "title": "库存卡管理",
- "icon": "el-icon-postcard",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "user-mgt",
- "component": "self/params-mgt/user-mgt",
- "name": "user-mgt",
- "meta": {
- "title": "用户管理",
- "icon": "el-icon-user",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "role-mgt",
- "component": "self/params-mgt/role-mgt",
- "name": "role-mgt",
- "meta": {
- "title": "角色管理",
- "icon": "el-icon-menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/self/other-config",
- "component": "Layout",
- "name": "/other-config",
- "meta": {
- "title": "其他配置",
- "icon": "system",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "print-template",
- "component": "self/other-config/print-template",
- "name": "print",
- "meta": {
- "title": "打印模板",
- "icon": "el-icon-printer",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "other",
- "component": "self/other-config/other",
- "name": "config",
- "meta": {
- "title": "其他配置",
- "icon": "el-icon-setting",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
-
- {
- "path": "/system",
- "component": "Layout",
- "redirect": "/system/user",
- "name": "/system",
- "meta": {
- "title": "系统管理",
- "icon": "system",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "user",
- "component": "system/user/index",
- "name": "User",
- "meta": {
- "title": "用户管理",
- "icon": "el-icon-User",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "role",
- "component": "system/role/index",
- "name": "Role",
- "meta": {
- "title": "角色管理",
- "icon": "role",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "menu",
- "component": "system/menu/index",
- "name": "Menu",
- "meta": {
- "title": "菜单管理",
- "icon": "menu",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "dept",
- "component": "system/dept/index",
- "name": "Dept",
- "meta": {
- "title": "部门管理",
- "icon": "tree",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "dict",
- "component": "system/dict/index",
- "name": "Dict",
- "meta": {
- "title": "字典管理",
- "icon": "dict",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/component",
- "component": "Layout",
- "name": "/component",
- "meta": {
- "title": "组件封装",
- "icon": "menu",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "curd",
- "component": "demo/curd/index",
- "name": "Curd",
- "meta": {
- "title": "增删改查",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "table-select",
- "component": "demo/table-select/index",
- "name": "TableSelect",
- "meta": {
- "title": "列表选择器",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "wang-editor",
- "component": "demo/wang-editor",
- "name": "WangEditor",
- "meta": {
- "title": "富文本编辑器",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "upload",
- "component": "demo/upload",
- "name": "Upload",
- "meta": {
- "title": "图片上传",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "icon-selector",
- "component": "demo/icon-selector",
- "name": "IconSelector",
- "meta": {
- "title": "图标选择器",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "dict-demo",
- "component": "demo/dict",
- "name": "DictDemo",
- "meta": {
- "title": "字典组件",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- },
- {
- "path": "/route-param",
- "component": "Layout",
- "name": "/routeParam",
- "meta": {
- "title": "路由参数",
- "icon": "el-icon-ElementPlus",
- "hidden": false,
- "alwaysShow": true,
- "params": null
- },
- "children": [
- {
- "path": "route-param-type1",
- "component": "demo/route-param",
- "name": "RouteParamType1",
- "meta": {
- "title": "参数(type=1)",
- "icon": "el-icon-Star",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "type": "1"
- }
- }
- },
- {
- "path": "route-param-type2",
- "component": "demo/route-param",
- "name": "RouteParamType2",
- "meta": {
- "title": "参数(type=2)",
- "icon": "el-icon-StarFilled",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": {
- "type": "2"
- }
- }
- }
- ]
- },
- {
- "path": "/function",
- "component": "Layout",
- "name": "/function",
- "meta": {
- "title": "功能演示",
- "icon": "menu",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- },
- "children": [
- {
- "path": "icon-demo",
- "component": "demo/icons",
- "name": "IconDemo",
- "meta": {
- "title": "Icons",
- "icon": "el-icon-Notification",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "/function/websocket",
- "component": "demo/websocket",
- "name": "/function/websocket",
- "meta": {
- "title": "Websocket",
- "icon": "",
- "hidden": false,
- "keepAlive": true,
- "alwaysShow": false,
- "params": null
- }
- },
- {
- "path": "other/:id",
- "component": "demo/other",
- "name": "Other/:id",
- "meta": {
- "title": "敬请期待...",
- "icon": "",
- "hidden": false,
- "alwaysShow": false,
- "params": null
- }
- }
- ]
- }
-]
diff --git a/src/json/menus.json b/src/json/menus.json
index fe51488..1f3a317 100644
--- a/src/json/menus.json
+++ b/src/json/menus.json
@@ -1 +1,104 @@
-[]
+[
+ {
+ "path": "/self/battery",
+ "component": "Layout",
+ "name": "/battery",
+ "meta": {
+ "title": "电池回收",
+ "icon": "",
+ "hidden": false,
+ "alwaysShow": false,
+ "params": null
+ },
+ "children": [
+ {
+ "path": "b-inquiry",
+ "component": "self/battery/b-inquiry",
+ "name": "b-inquiry",
+ "meta": {
+ "title": "询价管理",
+ "icon": "",
+ "hidden": false,
+ "keepAlive": true,
+ "alwaysShow": false
+ }
+ },
+ {
+ "path": "b-regis",
+ "component": "self/battery/b-regis",
+ "name": "b-regis",
+ "meta": {
+ "title": "登记列表",
+ "icon": "",
+ "hidden": false,
+ "keepAlive": true,
+ "alwaysShow": false
+ }
+ }
+ ]
+ },
+ {
+ "path": "/self/vehicle",
+ "component": "Layout",
+ "name": "/vehicle",
+ "meta": {
+ "title": "汽车回收",
+ "icon": "",
+ "hidden": false,
+ "alwaysShow": false,
+ "params": null
+ },
+ "children": [
+ {
+ "path": "v-inquiry",
+ "component": "self/vehicle/v-inquiry",
+ "name": "v-inquiry",
+ "meta": {
+ "title": "询价管理",
+ "icon": "",
+ "hidden": false,
+ "keepAlive": true,
+ "alwaysShow": false
+ }
+ },
+ {
+ "path": "v-regis",
+ "component": "self/vehicle/v-regis",
+ "name": "v-regis",
+ "meta": {
+ "title": "登记列表",
+ "icon": "",
+ "hidden": false,
+ "keepAlive": true,
+ "alwaysShow": false
+ }
+ }
+ ]
+ },
+ {
+ "path": "/self/steel",
+ "component": "Layout",
+ "name": "/steel",
+ "meta": {
+ "title": "废钢回收",
+ "icon": "",
+ "hidden": false,
+ "alwaysShow": false,
+ "params": null
+ },
+ "children": [
+ {
+ "path": "s-regis",
+ "component": "self/steel/s-regis",
+ "name": "s-regis",
+ "meta": {
+ "title": "申请列表",
+ "icon": "",
+ "hidden": false,
+ "keepAlive": true,
+ "alwaysShow": false
+ }
+ }
+ ]
+ }
+]
diff --git a/src/layout/components/NavBar/components/NavbarAction.vue b/src/layout/components/NavBar/components/NavbarAction.vue
index ff03d78..4e0631b 100644
--- a/src/layout/components/NavBar/components/NavbarAction.vue
+++ b/src/layout/components/NavBar/components/NavbarAction.vue
@@ -71,7 +71,8 @@
:src="userStore.user.avatar + '?imageView2/1/w/80/h/80'"
class="rounded-full mr-10px w24px w24px"
/> -->
- {{ userStore.user.userInfo.name }}
+
+ admin
diff --git a/src/plugins/permission.ts b/src/plugins/permission.ts
index beafd31..601bfe3 100644
--- a/src/plugins/permission.ts
+++ b/src/plugins/permission.ts
@@ -16,18 +16,18 @@ export function setupPermission() {
NProgress.start();
const hasToken = localStorage.getItem(TOKEN_KEY);
- if (hasToken) {
+ if (true) {
if (to.path === "/login") {
// 如果已登录,跳转到首页
next({ path: "/" });
NProgress.done();
} else {
- const userStore = useUserStore();
+ debugger;
+ // const userStore = useUserStore();
- await userStore.getUserInfo();
+ // await userStore.getUserInfo();
const permissionStore = usePermissionStore();
-
- const dynamicRoutes = await permissionStore.generateRoutes();
+ const dynamicRoutes = permissionStore.routes;
dynamicRoutes.forEach((route: RouteRecordRaw) =>
router.addRoute(route)
);
@@ -56,14 +56,6 @@ export function setupPermission() {
// }
}
} else {
- // 未登录
- if (whiteList.includes(to.path)) {
- next(); // 在白名单,直接进入
- } else {
- // 不在白名单,重定向到登录页
- redirectToLogin(to, next);
- NProgress.done();
- }
}
});
@@ -88,19 +80,20 @@ export function hasAuth(
value: string | string[],
type: "button" | "role" = "button"
) {
- const { roleList, perm } = useUserStore().user;
+ // const { roleList, perm } = useUserStore().user;
- if (roleList.length === 0) {
- ElMessage.error("当前用户未配置任何权限");
- return false;
- }
- // 超级管理员 拥有所有权限
- if (type === "button" && roleList[0].roleCode.includes("ROOT")) {
- return true;
- }
+ // if (roleList.length === 0) {
+ // ElMessage.error("当前用户未配置任何权限");
+ // return false;
+ // }
+ // // 超级管理员 拥有所有权限
+ // if (type === "button" && roleList[0].roleCode.includes("ROOT")) {
+ // return true;
+ // }
- const auths = type === "button" ? perm : roleList;
- return typeof value === "string"
- ? auths.includes(value)
- : value.some((perm) => auths.includes(perm));
+ // const auths = type === "button" ? perm : roleList;
+ // return typeof value === "string"
+ // ? auths.includes(value)
+ // : value.some((perm) => auths.includes(perm));
+ return true;
}
diff --git a/src/router/index.ts b/src/router/index.ts
index 4b10c47..889643a 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -41,7 +41,6 @@ export const constantRoutes: RouteRecordRaw[] = [
icon: "homepage",
affix: true,
keepAlive: true,
- hidden: true,
},
},
{
@@ -122,9 +121,9 @@ const router = createRouter({
// 全局注册 router
export function setupRouter(app: App) {
- // const permissionStore = usePermissionStore();
- // const dynamicRoutes = permissionStore.routes;
- // dynamicRoutes.forEach((route: RouteRecordRaw) => router.addRoute(route));
+ const permissionStore = usePermissionStore();
+ const dynamicRoutes = permissionStore.routes;
+ dynamicRoutes.forEach((route: RouteRecordRaw) => router.addRoute(route));
app.use(router);
}
diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts
index 80ddbea..4220e22 100644
--- a/src/store/modules/permission.ts
+++ b/src/store/modules/permission.ts
@@ -10,6 +10,7 @@ import menusJson from "@/json/menus.json";
const menus = menusJson;
export const usePermissionStore = defineStore("permission", () => {
+ // console.log(transformRoutes(menus as any));
/**
* 应用中所有的路由列表,包括静态路由和动态路由
*/
@@ -28,13 +29,19 @@ export const usePermissionStore = defineStore("permission", () => {
*/
function generateRoutes() {
return new Promise((resolve, reject) => {
- const dynamicRoutes = transformRoutes(menus);
+ const dynamicRoutes = transformRoutes([]);
routes.value = constantRoutes.concat(dynamicRoutes);
+ // dynamicRoutes.forEach((route: RouteRecordRaw) =>
+ // router.addRoute(route)
+ // );
resolve(dynamicRoutes);
// MenuAPI.getRoutes()
// .then((data) => {
// const dynamicRoutes = transformRoutes(data);
// routes.value = constantRoutes.concat(dynamicRoutes);
+ // // dynamicRoutes.forEach((route: RouteRecordRaw) =>
+ // // router.addRoute(route)
+ // // );
// resolve(dynamicRoutes);
// })
// .catch((error) => {
diff --git a/src/views/self/battery/b-inquiry.vue b/src/views/self/battery/b-inquiry.vue
new file mode 100644
index 0000000..de4c357
--- /dev/null
+++ b/src/views/self/battery/b-inquiry.vue
@@ -0,0 +1 @@
+111
diff --git a/src/views/self/battery/b-regis.vue b/src/views/self/battery/b-regis.vue
new file mode 100644
index 0000000..e76c4cd
--- /dev/null
+++ b/src/views/self/battery/b-regis.vue
@@ -0,0 +1 @@
+222
diff --git a/src/views/self/steel/s-regis.vue b/src/views/self/steel/s-regis.vue
new file mode 100644
index 0000000..1c749aa
--- /dev/null
+++ b/src/views/self/steel/s-regis.vue
@@ -0,0 +1 @@
+333
diff --git a/src/views/self/vehicle/v-inquiry.vue b/src/views/self/vehicle/v-inquiry.vue
new file mode 100644
index 0000000..d509f2c
--- /dev/null
+++ b/src/views/self/vehicle/v-inquiry.vue
@@ -0,0 +1 @@
+444
diff --git a/src/views/self/vehicle/v-regis.vue b/src/views/self/vehicle/v-regis.vue
new file mode 100644
index 0000000..8eb8eab
--- /dev/null
+++ b/src/views/self/vehicle/v-regis.vue
@@ -0,0 +1 @@
+555