diff --git a/.env.development b/.env.development
index 45fa738..c3a1946 100644
--- a/.env.development
+++ b/.env.development
@@ -12,7 +12,7 @@ VITE_APP_ENV = 'development'
# 寻驾/开发环境
# VITE_APP_BASE_API = 'https://cloud.ahduima.com/'
# VITE_APP_BASE_API = 'https://xj.ahduima.com/'
-VITE_APP_BASE_API = 'http://localhost:48080'
+VITE_APP_BASE_API = 'http://192.168.31.223:48080'
#
VITE_WEB_BASE_URL = 'https://xj.ahduima.com'
# VITE_WEB_BASE_URL = 'https://xj.ahduima.com'
diff --git a/package.json b/package.json
index 02947d3..7dd0879 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "xj-manage-h5",
"version": "2.0.0",
"scripts": {
- "dev:h5": "uni",
+ "dev:h5": "uni --host",
"dev": "uni -p mp-weixin",
"dev:dy": "uni -p mp-toutiao",
"build:h5": "uni build",
diff --git a/src/pages.json b/src/pages.json
index 051ec05..616554e 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -276,6 +276,12 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "pages/stats/personal",
+ "style": {
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pages/student/detail",
"style": {
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 0e54adb..034a07b 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -4,39 +4,38 @@
欢迎使用小程序管理系统
- 管理员视图
- 分销员视图
+ {{ userRole.map(role => role.name).join('、') }}
-
+
-
+
核心数据概览
-
+
📊
{{ distributionStats.totalProfit }}
分润总额
-
+
👥
{{ memberStats.totalOrders }}
会员订单
-
+
🎓
{{ studentStats.totalStudents }}
学员总数
-
+
📈
{{ distributionStats.scanCount }}
@@ -47,9 +46,9 @@
-
+
分销业绩统计
-
+
📈
@@ -61,9 +60,9 @@
-
+
会员运营统计
-
+
👥
@@ -75,9 +74,9 @@
-
+
学员学情统计
-
+
🎓
@@ -87,14 +86,10 @@
-
-
-
-
-
+
个人核心数据
-
+
📱
@@ -127,9 +122,9 @@
-
+
个人业绩统计
-
+
📊
@@ -141,7 +136,7 @@
-
+
+
+
\ No newline at end of file
diff --git a/src/utils/permission.js b/src/utils/permission.js
index 17969f2..e401c2c 100644
--- a/src/utils/permission.js
+++ b/src/utils/permission.js
@@ -1,4 +1,4 @@
-import store from '@/store'
+import { useUserStore } from '@/store/modules/user';
/**
* 字符权限校验
@@ -7,21 +7,20 @@ import store from '@/store'
*/
export function checkPermi(value) {
if (value && value instanceof Array && value.length > 0) {
- const permissions = store.getters && store.getters.permissions
- const permissionDatas = value
- const all_permission = "*:*:*"
-
+ const permissions = useUserStore().permissions;
+ const permissionDatas = value;
+ const all_permission = '*:*:*';
const hasPermission = permissions.some(permission => {
- return all_permission === permission || permissionDatas.includes(permission)
- })
+ return all_permission === permission || permissionDatas.includes(permission);
+ });
if (!hasPermission) {
- return false
+ return false;
}
- return true
+ return true;
} else {
- console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
- return false
+ console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`);
+ return false;
}
}
@@ -32,20 +31,20 @@ export function checkPermi(value) {
*/
export function checkRole(value) {
if (value && value instanceof Array && value.length > 0) {
- const roles = store.getters && store.getters.roles
- const permissionRoles = value
- const super_admin = "admin"
+ const roles = useUserStore().roles; // store.getters && store.getters.roles;
+ const permissionRoles = value;
+ const super_admin = 'admin';
const hasRole = roles.some(role => {
- return super_admin === role || permissionRoles.includes(role)
- })
+ return super_admin === role || permissionRoles.includes(role);
+ });
if (!hasRole) {
- return false
+ return false;
}
- return true
+ return true;
} else {
- console.error(`need roles! Like checkRole="['admin','editor']"`)
- return false
+ console.error(`need roles! Like checkRole="['admin','editor']"`);
+ return false;
}
-}
\ No newline at end of file
+}