aloux-iam 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/middleware.js CHANGED
@@ -1,91 +1,91 @@
1
- const jwt = require('jsonwebtoken')
2
- const User = require('./models/User')
3
- const Permission = require('./models/Permission')
4
-
5
- const getAccess = (user, resource) => {
6
- for(let i in user._functions){
7
- for(let j in user._functions[i]._permissions){
8
- if(user._functions[i]._permissions[j].status === 'Activo'){
9
- const permissionBack = user._functions[i]._permissions[j].method + ' ' + user._functions[i]._permissions[j].endpoint
10
- if(permissionBack === resource.method + ' ' + resource.endpoint){
11
- return true
12
- }
13
- }
14
- }
15
- }
16
- return false
17
- }
18
-
19
- const auth = async(req, res, next) => {
20
-
21
- try {
22
-
23
- let token = req.header('Authorization') || req.cookies && req.cookies.token
24
-
25
- if (!token) {
26
- throw {
27
- code: 401,
28
- title: 'Error de autenticación',
29
- detail: 'Endpoint requiere token',
30
- suggestion: 'Vuelve a iniciar sesion',
31
- error: new Error()
32
- }
33
- }
34
-
35
- token = token.replace('Bearer ', '')
36
-
37
- const data = jwt.verify(token, process.env.AUTH_SECRET)
38
- const user = await User.findOne({ _id: data._id, 'tokens.token': token, status: 'Activo' }, {"tokens":0,pwd:0}).populate({ path: "_functions", populate: [{ path: "_permissions"}] }).lean()
39
-
40
- if (!user) {
41
- throw {
42
- code: 401,
43
- title: 'Error de autenticación',
44
- detail: 'No se encontró el usuario',
45
- suggestion: 'Vuelve a iniciar sesion',
46
- error: new Error()
47
- }
48
- }
49
-
50
- const resource = await Permission.findOne({ method: req.originalMethod, endpoint: req.route.path }).lean()
51
- if(!resource){
52
- throw {
53
- code: 403,
54
- title: 'Error de recurso',
55
- detail: 'No se encontro dado de alta el privilegio del endpoint: [' + req.route.path + ']',
56
- suggestion: 'Contacta con el administrador',
57
- error: new Error()
58
- }
59
- }
60
-
61
- if(resource.auth){
62
- const access = getAccess(user, resource)
63
- if (!access) {
64
- throw {
65
- code: 403,
66
- title: 'Error de permisos',
67
- detail: 'No cuentas con permisos para el recurso [' + resource.api +'] que: ' + (resource ? resource.description : 'Recurso indefinido' ),
68
- suggestion: 'Contacta con el administrador',
69
- error: new Error()
70
- }
71
- }
72
- }
73
-
74
- req.user = user
75
- req.token = token
76
- next()
77
- } catch (error) {
78
- let obj = error
79
- if(!error.code){
80
- obj = {
81
- code: 401,
82
- title: 'Error de autenticación',
83
- detail: error.message,
84
- suggestion: 'Vuelve a iniciar sesion'
85
- }
86
- }
87
- res.status(obj.code).send(obj)
88
- }
89
- }
90
-
1
+ const jwt = require('jsonwebtoken')
2
+ const User = require('./models/User')
3
+ const Permission = require('./models/Permission')
4
+
5
+ const getAccess = (user, resource) => {
6
+ for(let i in user._functions){
7
+ for(let j in user._functions[i]._permissions){
8
+ if(user._functions[i]._permissions[j].status === 'Activo'){
9
+ const permissionBack = user._functions[i]._permissions[j].method + ' ' + user._functions[i]._permissions[j].endpoint
10
+ if(permissionBack === resource.method + ' ' + resource.endpoint){
11
+ return true
12
+ }
13
+ }
14
+ }
15
+ }
16
+ return false
17
+ }
18
+
19
+ const auth = async(req, res, next) => {
20
+
21
+ try {
22
+
23
+ let token = req.header('Authorization') || req.cookies && req.cookies.token
24
+
25
+ if (!token) {
26
+ throw {
27
+ code: 401,
28
+ title: 'Error de autenticación',
29
+ detail: 'Endpoint requiere token',
30
+ suggestion: 'Vuelve a iniciar sesion',
31
+ error: new Error()
32
+ }
33
+ }
34
+
35
+ token = token.replace('Bearer ', '')
36
+
37
+ const data = jwt.verify(token, process.env.AUTH_SECRET)
38
+ const user = await User.findOne({ _id: data._id, 'tokens.token': token, status: 'Activo' }, {"tokens":0,pwd:0}).populate({ path: "_functions", populate: [{ path: "_permissions"}] }).lean()
39
+
40
+ if (!user) {
41
+ throw {
42
+ code: 401,
43
+ title: 'Error de autenticación',
44
+ detail: 'No se encontró el usuario',
45
+ suggestion: 'Vuelve a iniciar sesion',
46
+ error: new Error()
47
+ }
48
+ }
49
+
50
+ const resource = await Permission.findOne({ method: req.originalMethod, endpoint: req.route.path }).lean()
51
+ if(!resource){
52
+ throw {
53
+ code: 403,
54
+ title: 'Error de recurso',
55
+ detail: 'No se encontro dado de alta el privilegio del endpoint: [' + req.route.path + ']',
56
+ suggestion: 'Contacta con el administrador',
57
+ error: new Error()
58
+ }
59
+ }
60
+
61
+ if(resource.auth){
62
+ const access = getAccess(user, resource)
63
+ if (!access) {
64
+ throw {
65
+ code: 403,
66
+ title: 'Error de permisos',
67
+ detail: 'No cuentas con permisos para el recurso [' + resource.api +'] que: ' + (resource ? resource.description : 'Recurso indefinido' ),
68
+ suggestion: 'Contacta con el administrador',
69
+ error: new Error()
70
+ }
71
+ }
72
+ }
73
+
74
+ req.user = user
75
+ req.token = token
76
+ next()
77
+ } catch (error) {
78
+ let obj = error
79
+ if(!error.code){
80
+ obj = {
81
+ code: 401,
82
+ title: 'Error de autenticación',
83
+ detail: error.message,
84
+ suggestion: 'Vuelve a iniciar sesion'
85
+ }
86
+ }
87
+ res.status(obj.code).send(obj)
88
+ }
89
+ }
90
+
91
91
  module.exports = auth
@@ -1,14 +1,14 @@
1
- const mongoose = require('mongoose')
2
-
3
- const functionsSchema = mongoose.Schema({
4
- name: { type: String, required: true, trim: true, unique: true },
5
- description: { type: String, trim: true },
6
- _permissions: [ { type: mongoose.Schema.Types.ObjectId, required: true, ref: 'Permission' } ],
7
- _menus: [ { type: mongoose.Schema.Types.ObjectId, required: true, ref: 'Menu' } ],
8
- status: { type: String },
9
- createdAt: { type: Number },
10
- lastUpdate: { type: Number }
11
- })
12
-
13
- const Functions = mongoose.model("Functions", functionsSchema)
1
+ const mongoose = require('mongoose')
2
+
3
+ const functionsSchema = mongoose.Schema({
4
+ name: { type: String, required: true, trim: true, unique: true },
5
+ description: { type: String, trim: true },
6
+ _permissions: [ { type: mongoose.Schema.Types.ObjectId, required: true, ref: 'Permission' } ],
7
+ _menus: [ { type: mongoose.Schema.Types.ObjectId, required: true, ref: 'Menu' } ],
8
+ status: { type: String },
9
+ createdAt: { type: Number },
10
+ lastUpdate: { type: Number }
11
+ })
12
+
13
+ const Functions = mongoose.model("Functions", functionsSchema)
14
14
  module.exports = Functions
@@ -1,16 +1,16 @@
1
- const mongoose = require('mongoose')
2
-
3
- const menuSchema = mongoose.Schema({
4
- label: { type: String, required: true, trim: true },
5
- path: { type: String, required: true, trim: true },
6
- icon: { type: String, required: true, trim: true },
7
- index: { type: Number },
8
- _menu: { type: mongoose.Schema.Types.ObjectId, ref: 'Menu' },
9
-
10
- status: { type: String },
11
- createdAt: { type: Number },
12
- lastUpdate: { type: Number }
13
- })
14
-
15
- const Menu = mongoose.model("Menu", menuSchema)
1
+ const mongoose = require('mongoose')
2
+
3
+ const menuSchema = mongoose.Schema({
4
+ label: { type: String, required: true, trim: true },
5
+ path: { type: String, required: true, trim: true },
6
+ icon: { type: String, required: true, trim: true },
7
+ index: { type: Number },
8
+ _menu: { type: mongoose.Schema.Types.ObjectId, ref: 'Menu' },
9
+
10
+ status: { type: String },
11
+ createdAt: { type: Number },
12
+ lastUpdate: { type: Number }
13
+ })
14
+
15
+ const Menu = mongoose.model("Menu", menuSchema)
16
16
  module.exports = Menu
@@ -1,15 +1,15 @@
1
- const mongoose = require('mongoose')
2
-
3
- const permissionSchema = mongoose.Schema({
4
- description: { type: String, required: true, trim: true },
5
- method: { type: String, required: true, unique: true },
6
- api: { type: String, required: true },
7
- endpoint: { type: String, required: true },
8
- auth: { type: Number, required: true, default: 1},
9
- status: { type: String },
10
- createdAt: { type: Number },
11
- lastUpdate: { type: Number }
12
- })
13
-
14
- const Permission = mongoose.model('Permission', permissionSchema)
1
+ const mongoose = require('mongoose')
2
+
3
+ const permissionSchema = mongoose.Schema({
4
+ description: { type: String, required: true, trim: true },
5
+ method: { type: String, required: true, unique: true },
6
+ api: { type: String, required: true },
7
+ endpoint: { type: String, required: true },
8
+ auth: { type: Number, required: true, default: 1},
9
+ status: { type: String },
10
+ createdAt: { type: Number },
11
+ lastUpdate: { type: Number }
12
+ })
13
+
14
+ const Permission = mongoose.model('Permission', permissionSchema)
15
15
  module.exports = Permission
@@ -1,103 +1,104 @@
1
- const mongoose = require("mongoose")
2
- const bcrypt = require("bcryptjs")
3
- const jwt = require("jsonwebtoken")
4
- const ObjectId = mongoose.Schema.Types.ObjectId
5
-
6
- const adminSchema = mongoose.Schema({
7
- name: { type: String, required: true, trim: true },
8
- lastName: { type: String, required: false, trim: true },
9
- email: { type: String, required: true, trim: true, unique: true, lowercase: true },
10
- pwd: { type: String, trim: true, minLength: 8 },
11
- phone: { type: String, trim: true, maxLength: 13 },
12
- phoneObj: {
13
- phone: { type: String, trim: true, maxLength: 10 },
14
- phoneInternacional: { type: String, trim: true, maxLength: 13 },
15
- dialCode: { type: String, trim: true, maxLength: 3 },
16
- country: { type: String, trim: true, maxLength: 50 },
17
- regionCode: { type: String, trim: true, maxLength: 3 }
18
- },
19
- urlImg: { type: String },
20
- data: { type: Object },
21
- validateKey: {
22
- limitCodeTime: { type: Number },
23
- resetPassword: {
24
- resetCode: { type: Number },
25
- validCode: { type: Boolean, default: false },
26
- },
27
- validateEmail: {
28
- emailVerified: { type: Boolean, default: false },
29
- verifyMailToken: { type: String },
30
- },
31
- validatePhone: {
32
- codeVerifyPhone: { type: Number },
33
- validCodePhone: { type: Boolean, default: false },
34
- }
35
- },
36
- _functions: [
37
- {
38
- type: ObjectId, required: true, ref: 'Functions'
39
- }
40
- ],
41
- _business: [
42
- {
43
- type: ObjectId, ref: 'Business'
44
- }
45
- ],
46
- _client: [
47
- {
48
- type: ObjectId, ref: 'Client'
49
- }
50
- ],
51
- tokens: [
52
- {
53
- token: { type: String, required: true },
54
- date: { type: Number }
55
- }
56
- ],
57
-
58
- status: { type: String },
59
- createdAt: { type: Number },
60
- lastUpdate: { type: Number }
61
- })
62
-
63
- adminSchema.pre("save", async function (next) {
64
- const user = this
65
-
66
- if (user.isModified("pwd")) {
67
- user.pwd = await bcrypt.hash(user.pwd, 8)
68
- }
69
-
70
- next()
71
- })
72
-
73
- adminSchema.methods.generateAuthToken = async function () {
74
- const user = this
75
-
76
- const token = jwt.sign({ _id: user._id }, process.env.AUTH_SECRET)
77
- user.tokens = user.tokens.concat({ token })
78
-
79
- await user.save()
80
-
81
- return token
82
- }
83
-
84
- adminSchema.statics.findByCredentials = async (email, pwd) => {
85
- try {
86
- const user = await User.findOne({ email: email })
87
-
88
- if (!user) {
89
- throw new Error({ error: "Invalid login credentials" })
90
- }
91
-
92
- const isPasswordMatch = await bcrypt.compare(pwd, user.pwd)
93
-
94
- if (!isPasswordMatch) {
95
- throw new Error({ error: "Invalid login credentials" })
96
- }
97
-
98
- return user
99
- } catch (error) { }
100
- }
101
-
102
- const User = mongoose.model("User", adminSchema)
103
- module.exports = User
1
+ const mongoose = require("mongoose")
2
+ const bcrypt = require("bcryptjs")
3
+ const jwt = require("jsonwebtoken")
4
+ const ObjectId = mongoose.Schema.Types.ObjectId
5
+
6
+ const adminSchema = mongoose.Schema({
7
+ name: { type: String, required: true, trim: true },
8
+ lastName: { type: String, required: false, trim: true },
9
+ email: { type: String, required: true, trim: true, unique: true, lowercase: true },
10
+ pwd: { type: String, trim: true, minLength: 8 },
11
+ phone: { type: String, trim: true, maxLength: 13 },
12
+ phoneObj: {
13
+ e164: { type: String, trim: true, maxLength: 13 },
14
+ input: { type: String, trim: true, maxLength: 10 },
15
+ international: { type: String, trim: true, maxLength: 20 },
16
+ national: { type: String, trim: true, maxLength: 13 },
17
+ rfc3966: { type: String, trim: true, maxLength: 30 },
18
+ significant: { type: String, trim: true, maxLength: 10 }
19
+ },
20
+ urlImg: { type: String },
21
+ data: { type: Object },
22
+ validateKey: {
23
+ limitCodeTime: { type: Number },
24
+ resetPassword: {
25
+ resetCode: { type: Number },
26
+ validCode: { type: Boolean, default: false },
27
+ },
28
+ validateEmail: {
29
+ emailVerified: { type: Boolean, default: false },
30
+ verifyMailToken: { type: String },
31
+ },
32
+ validatePhone: {
33
+ codeVerifyPhone: { type: Number },
34
+ validCodePhone: { type: Boolean, default: false },
35
+ }
36
+ },
37
+ _functions: [
38
+ {
39
+ type: ObjectId, required: true, ref: 'Functions'
40
+ }
41
+ ],
42
+ _business: [
43
+ {
44
+ type: ObjectId, ref: 'Business'
45
+ }
46
+ ],
47
+ _client: [
48
+ {
49
+ type: ObjectId, ref: 'Client'
50
+ }
51
+ ],
52
+ tokens: [
53
+ {
54
+ token: { type: String, required: true },
55
+ date: { type: Number }
56
+ }
57
+ ],
58
+
59
+ status: { type: String },
60
+ createdAt: { type: Number },
61
+ lastUpdate: { type: Number }
62
+ })
63
+
64
+ adminSchema.pre("save", async function (next) {
65
+ const user = this
66
+
67
+ if (user.isModified("pwd")) {
68
+ user.pwd = await bcrypt.hash(user.pwd, 8)
69
+ }
70
+
71
+ next()
72
+ })
73
+
74
+ adminSchema.methods.generateAuthToken = async function () {
75
+ const user = this
76
+
77
+ const token = jwt.sign({ _id: user._id }, process.env.AUTH_SECRET)
78
+ user.tokens = user.tokens.concat({ token })
79
+
80
+ await user.save()
81
+
82
+ return token
83
+ }
84
+
85
+ adminSchema.statics.findByCredentials = async (email, pwd) => {
86
+ try {
87
+ const user = await User.findOne({ email: email })
88
+
89
+ if (!user) {
90
+ throw new Error({ error: "Invalid login credentials" })
91
+ }
92
+
93
+ const isPasswordMatch = await bcrypt.compare(pwd, user.pwd)
94
+
95
+ if (!isPasswordMatch) {
96
+ throw new Error({ error: "Invalid login credentials" })
97
+ }
98
+
99
+ return user
100
+ } catch (error) { }
101
+ }
102
+
103
+ const User = mongoose.model("User", adminSchema)
104
+ module.exports = User
package/lib/router.js CHANGED
@@ -1,73 +1,73 @@
1
- const express = require('express')
2
- const middleware = require('./middleware.js')
3
- const router = express.Router()
4
-
5
- const auth = require('./controllers/auth')
6
- const user = require('./controllers/user')
7
- const menu = require('./controllers/menu')
8
- const permission = require('./controllers/permission')
9
- const functions = require('./controllers/functions')
10
-
11
- // User / user self (no auth)
12
- router.post('/iam/auth/email', auth.email)
13
- router.post('/iam/auth/login', auth.login)
14
- router.post('/iam/auth/forgot/password', auth.recoverpassword)
15
- router.post('/iam/auth/validate/code', auth.verifyCode)
16
- router.post('/iam/auth/verify/mail', auth.sendVerifyMailAccount)
17
- router.get('/iam/auth/verify/mail/token/:token', auth.verifyMailTokenAccount)
18
- router.post('/iam/auth/reset/password', auth.resetPassword)
19
- router.post('/iam/auth/signup', auth.createCustomer)
20
-
21
- // User / user self
22
- router.get('/iam/auth/me', middleware, auth.me)
23
- router.put('/iam/auth/profile', middleware, auth.updateAny)
24
- router.put('/iam/auth/profile/pictura', middleware, auth.updatePicture)
25
- router.put('/iam/auth/reset/password', middleware, auth.resetPass)
26
- router.post('/iam/auth/send/verify/phone', middleware, auth.verifyPhone)
27
- router.post('/iam/auth/verify/phone', middleware, auth.validatePhone)
28
- router.post('/iam/auth/logout', middleware, auth.logout)
29
-
30
-
31
- // IAM / User
32
- router.post('/iam/user', middleware, user.create)
33
- router.get('/iam/user', middleware, user.retrieve)
34
- router.get('/iam/user/:USER_ID', middleware, user.get)
35
- router.patch('/iam/user/:USER_ID', middleware, user.update)
36
- router.put('/iam/user/:USER_ID/status', middleware, user.status)
37
- router.put('/iam/user/password/:USER_ID', middleware, user.updatepassword)
38
- router.delete('/iam/user/:USER_ID', middleware, user.delete)
39
- router.get('/iam/user/count/all', middleware, user.count)
40
-
41
-
42
- // IAM / Function
43
- router.post('/iam/functions', middleware, functions.create)
44
- router.patch('/iam/functions/:FUNCTION_ID', middleware, functions.update)
45
- router.put('/iam/functions/:FUNCTION_ID/status', middleware, functions.status)
46
- router.get('/iam/functions', middleware, functions.retrieve)
47
- router.get('/iam/functions/:FUNCTION_ID', middleware, functions.get)
48
- router.delete('/iam/functions/:FUNCTION_ID', middleware, functions.delete)
49
- router.get('/iam/functions/count/all', middleware, functions.count)
50
-
51
-
52
- // IAM / Permission
53
- router.post('/iam/permission', middleware, permission.create)
54
- router.patch('/iam/permission/:PERMISSION_ID', middleware, permission.update)
55
- router.put('/iam/permission/:PERMISSION_ID/status', middleware, permission.status)
56
- router.get('/iam/permission', middleware, permission.retrieve)
57
- router.get('/iam/permission/:PERMISSION_ID', middleware, permission.get)
58
- router.delete('/iam/permission/:PERMISSION_ID', middleware, permission.delete)
59
- router.get('/iam/permission/count/all', middleware, permission.count)
60
-
61
-
62
- // IAM / Menu
63
- router.post('/iam/menu', middleware, menu.create)
64
- router.patch('/iam/menu/:MENU_ID', middleware, menu.update)
65
- router.put('/iam/menu/:MENU_ID/status', middleware, menu.status)
66
- router.get('/iam/menu', middleware, menu.retrieve)
67
- router.get('/iam/menu/:MENU_ID', middleware, menu.get)
68
- router.delete('/iam/menu/:MENU_ID', middleware, menu.delete)
69
- router.post('/iam/menu/order', middleware, menu.order)
70
- router.get('/iam/menu/count/all', middleware, menu.count)
71
-
72
-
1
+ const express = require('express')
2
+ const middleware = require('./middleware.js')
3
+ const router = express.Router()
4
+
5
+ const auth = require('./controllers/auth')
6
+ const user = require('./controllers/user')
7
+ const menu = require('./controllers/menu')
8
+ const permission = require('./controllers/permission')
9
+ const functions = require('./controllers/functions')
10
+
11
+ // User / user self (no auth)
12
+ router.post('/iam/auth/email', auth.email)
13
+ router.post('/iam/auth/login', auth.login)
14
+ router.post('/iam/auth/forgot/password', auth.recoverpassword)
15
+ router.post('/iam/auth/validate/code', auth.verifyCode)
16
+ router.post('/iam/auth/verify/mail', auth.sendVerifyMailAccount)
17
+ router.get('/iam/auth/verify/mail/token/:token', auth.verifyMailTokenAccount)
18
+ router.post('/iam/auth/reset/password', auth.resetPassword)
19
+ router.post('/iam/auth/signup', auth.createCustomer)
20
+
21
+ // User / user self
22
+ router.get('/iam/auth/me', middleware, auth.me)
23
+ router.put('/iam/auth/profile', middleware, auth.updateAny)
24
+ router.put('/iam/auth/profile/pictura', middleware, auth.updatePicture)
25
+ router.put('/iam/auth/reset/password', middleware, auth.resetPass)
26
+ router.post('/iam/auth/send/verify/phone', middleware, auth.verifyPhone)
27
+ router.post('/iam/auth/verify/phone', middleware, auth.validatePhone)
28
+ router.post('/iam/auth/logout', middleware, auth.logout)
29
+
30
+
31
+ // IAM / User
32
+ router.post('/iam/user', middleware, user.create)
33
+ router.get('/iam/user', middleware, user.retrieve)
34
+ router.get('/iam/user/:USER_ID', middleware, user.get)
35
+ router.patch('/iam/user/:USER_ID', middleware, user.update)
36
+ router.put('/iam/user/:USER_ID/status', middleware, user.status)
37
+ router.put('/iam/user/password/:USER_ID', middleware, user.updatepassword)
38
+ router.delete('/iam/user/:USER_ID', middleware, user.delete)
39
+ router.get('/iam/user/count/all', middleware, user.count)
40
+
41
+
42
+ // IAM / Function
43
+ router.post('/iam/functions', middleware, functions.create)
44
+ router.patch('/iam/functions/:FUNCTION_ID', middleware, functions.update)
45
+ router.put('/iam/functions/:FUNCTION_ID/status', middleware, functions.status)
46
+ router.get('/iam/functions', middleware, functions.retrieve)
47
+ router.get('/iam/functions/:FUNCTION_ID', middleware, functions.get)
48
+ router.delete('/iam/functions/:FUNCTION_ID', middleware, functions.delete)
49
+ router.get('/iam/functions/count/all', middleware, functions.count)
50
+
51
+
52
+ // IAM / Permission
53
+ router.post('/iam/permission', middleware, permission.create)
54
+ router.patch('/iam/permission/:PERMISSION_ID', middleware, permission.update)
55
+ router.put('/iam/permission/:PERMISSION_ID/status', middleware, permission.status)
56
+ router.get('/iam/permission', middleware, permission.retrieve)
57
+ router.get('/iam/permission/:PERMISSION_ID', middleware, permission.get)
58
+ router.delete('/iam/permission/:PERMISSION_ID', middleware, permission.delete)
59
+ router.get('/iam/permission/count/all', middleware, permission.count)
60
+
61
+
62
+ // IAM / Menu
63
+ router.post('/iam/menu', middleware, menu.create)
64
+ router.patch('/iam/menu/:MENU_ID', middleware, menu.update)
65
+ router.put('/iam/menu/:MENU_ID/status', middleware, menu.status)
66
+ router.get('/iam/menu', middleware, menu.retrieve)
67
+ router.get('/iam/menu/:MENU_ID', middleware, menu.get)
68
+ router.delete('/iam/menu/:MENU_ID', middleware, menu.delete)
69
+ router.post('/iam/menu/order', middleware, menu.order)
70
+ router.get('/iam/menu/count/all', middleware, menu.count)
71
+
72
+
73
73
  module.exports = router