diff --git a/app/src/api/employee.js b/app/src/api/employee.js
index d73321c..b9a3c59 100644
--- a/app/src/api/employee.js
+++ b/app/src/api/employee.js
@@ -21,10 +21,14 @@ const getAllEmployee = (params) => {
params
})
}
+const loginEmployee = (params) => {
+ return http.post('/employee/login', params)
+}
export {
getEmployee,
createEmployee,
getAllEmployee,
updateEmployee,
- deleteEmployee
+ deleteEmployee,
+ loginEmployee
}
diff --git a/app/src/stores/modules/user.js b/app/src/stores/modules/user.js
index 3c8efa3..39dc49f 100644
--- a/app/src/stores/modules/user.js
+++ b/app/src/stores/modules/user.js
@@ -14,204 +14,26 @@ const useUserStore = defineStore(
() => {
// 模拟后台返回的token
const token = ref('')
+ const _id = ref('')
+ const name = ref('')
+ const userType = ref('')
const setToken = (newToken) => {
token.value = newToken
}
+ const setId = (newId) => {
+ _id.value = newId
+ }
+ const setName = (newName) => {
+ name.value = newName
+ }
+ const setUserType = (newUserType) => {
+ userType.value = newUserType
+ }
// 模拟后台返回的侧边栏数据
const asideData = ref([])
- // const asideData = ref([
- // {
- // index: '/home',
- // icon: 'icon iconfont icon-shujutongji',
- // name: '数据统计'
- // },
- // //
- // {
- // index: '/user-manage',
- // icon: 'icon iconfont icon-yonghuguanli',
- // name: '用户管理'
- // },
- // {
- // index: '/employee-manage',
- // icon: 'icon iconfont icon-shenfenzhongxin-xinxiguanlizhigongxinxiguanli',
- // name: '职工管理'
- // },
- // {
- // index: '/reward-manage',
- // icon: 'icon iconfont icon-gerenjixiao',
- // name: '绩效管理'
- // },
- // // 二级
- // {
- // index: '/feedback',
- // icon: 'icon iconfont icon-fankui',
- // name: '员工反馈与投诉管理',
- // children: [
- // {
- // index: '/feedback/manage',
- // name: '投诉管理'
- // },
- // {
- // index: '/feedback/view',
- // name: '员工反馈'
- // }
- // ]
- // },
- // {
- // index: '/request',
- // icon: 'icon iconfont icon-qingjiashenqing',
- // name: '请假管理',
- // children: [
- // {
- // index: '/request/manage',
- // name: '请假信息管理'
- // },
- // {
- // index: '/request/view',
- // name: '个人请假信息'
- // }
- // ]
- // },
- // {
- // index: '/person',
- // icon: 'icon iconfont icon-gerenxinxiguanli',
- // name: '个人信息管理',
- // children: [
- // {
- // index: '/person/password',
- // name: '修改密码'
- // },
- // {
- // index: '/person/avatar',
- // name: '修改个人信息'
- // }
- // ]
- // }
- // ])
// 模拟后台返回的路由数据
const routerData = ref([])
- // const routerData = ref([
- // {
- // path: 'home',
- // name: 'home',
- // meta: {
- // // 路由组件的路径
- // url: '../views/HomeView.vue'
- // }
- // },
- // {
- // path: 'table/main-table1',
- // name: 'main-table',
- // meta: {
- // name: '表格1',
- // url: '../views/table/MainTableView.vue'
- // }
- // },
- // {
- // path: 'excel',
- // name: 'excel',
-
- // meta: {
- // name: 'excel',
- // url: '../views/ExcelView.vue'
- // }
- // },
-
- // {
- // path: 'tx-yun',
- // name: 'tx-yun',
-
- // meta: {
- // name: 'tx-yun',
- // url: '../views/TxView.vue'
- // }
- // },
-
- // {
- // path: 'preview-picture',
- // name: 'preview-picture',
-
- // meta: {
- // name: 'preview-picture',
- // url: '../views/PreviewPictureView.vue'
- // }
- // },
- // //
- // {
- // path: 'user-manage',
- // name: 'user-manage',
- // meta: {
- // // 路由组件的路径
- // url: '../views/UserManageView.vue'
- // }
- // },
- // {
- // path: 'employee-manage',
- // name: 'employee-manage',
- // meta: {
- // // 路由组件的路径
- // url: '../views/EmployeeManageView.vue'
- // }
- // },
- // {
- // path: 'reward-manage',
- // name: 'reward-manage',
- // meta: {
- // // 路由组件的路径
- // url: '../views/RewardManageView.vue'
- // }
- // },
- // // 二级
- // {
- // path: 'feedback/manage',
- // name: 'feedback-manage',
- // meta: {
- // // 路由组件的路径
- // url: '../views/feedback/FeedbackManageView.vue'
- // }
- // },
- // {
- // path: 'feedback/view',
- // name: 'feedback-view',
- // meta: {
- // // 路由组件的路径
- // url: '../views/feedback/FeedbackView.vue'
- // }
- // },
- // {
- // path: 'request/manage',
- // name: 'request-manage',
- // meta: {
- // // 路由组件的路径
- // url: '../views/request/RequestManageView.vue'
- // }
- // },
- // {
- // path: 'request/view',
- // name: 'request-view',
- // meta: {
- // // 路由组件的路径
- // url: '../views/request/RequestView.vue'
- // }
- // },
- // {
- // path: 'person/password',
- // name: 'person-password',
- // meta: {
- // // 路由组件的路径
- // url: '../views/PersonInfo/ChangePasswordView.vue'
- // }
- // },
- // {
- // path: 'person/avatar',
- // name: 'person-avatar',
- // meta: {
- // // 路由组件的路径
- // url: '../views/PersonInfo/ChangeAvatarView.vue'
- // }
- // }
- // ])
// 动态添加路由
const addUserRoute = (router, modules) => {
routerData.value.forEach((item) => {
@@ -236,7 +58,13 @@ const useUserStore = defineStore(
routerData,
setToken,
token,
- asideData
+ asideData,
+ _id,
+ setId,
+ userType,
+ name,
+ setName,
+ setUserType
}
},
{
diff --git a/app/src/views/LoginView.vue b/app/src/views/LoginView.vue
index ef5fa2e..9df43ce 100644
--- a/app/src/views/LoginView.vue
+++ b/app/src/views/LoginView.vue
@@ -2,7 +2,7 @@
* @Author: BINGWU
* @Date: 2024-04-10 16:15:37
* @LastEditors: BINGWU HuJiaCheng2003@163.com
- * @LastEditTime: 2024-05-19 17:07:18
+ * @LastEditTime: 2024-05-23 11:34:56
* @FilePath: \employee-information-management-system\app\src\views\LoginView.vue
* @Describe:
* @Mark: ૮(˶ᵔ ᵕ ᵔ˶)ა
@@ -18,7 +18,16 @@