明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
letian_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengfanpei
letian_backend
Commits
cdff6f8c
Commit
cdff6f8c
authored
Dec 10, 2024
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a8c8ed97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
userController.js
controller/userController.js
+11
-11
userModule.js
module/userModule.js
+1
-1
No files found.
controller/userController.js
View file @
cdff6f8c
...
@@ -8,17 +8,17 @@ const createError = require('http-errors');
...
@@ -8,17 +8,17 @@ const createError = require('http-errors');
const
userModule
=
require
(
'../module/userModule'
);
const
userModule
=
require
(
'../module/userModule'
);
const
errorMessage
=
require
(
'../utils/errorMessage'
);
const
errorMessage
=
require
(
'../utils/errorMessage'
);
setTimeout
(
async
()
=>
{
//
setTimeout(async () => {
const
{
salt
,
passwordHash
}
=
utils
.
saltHashPassword
(
"123456"
);
//
const { salt, passwordHash } = utils.saltHashPassword("123456");
const
mobile
=
"11111111111"
;
//
const mobile = "11111111111";
const
_id
=
"66d6c4099f8480c6db53ce13"
;
//
const _id = "66d6c4099f8480c6db53ce13";
await
userModule
.
findOneAndUpdate
({
_id
},
{
//
await userModule.findOneAndUpdate({ _id }, {
mobile
,
//
mobile,
salt
,
//
salt,
name
:
"系统管理员"
,
//
name: "系统管理员",
password
:
passwordHash
,
//
password: passwordHash,
},
{
upsert
:
true
})
//
}, { upsert: true })
},
"5000"
);
//
}, "5000");
// 注册 暂时用作注册admin 后续用户应该以后台添加方式进行
// 注册 暂时用作注册admin 后续用户应该以后台添加方式进行
async
function
regist
(
req
,
res
,
next
)
{
async
function
regist
(
req
,
res
,
next
)
{
...
...
module/userModule.js
View file @
cdff6f8c
...
@@ -37,7 +37,7 @@ async function findOneAndUpdate(filter, updateObj) {
...
@@ -37,7 +37,7 @@ async function findOneAndUpdate(filter, updateObj) {
async
function
getRoleMenus
(
roles
,
mobile
)
{
async
function
getRoleMenus
(
roles
,
mobile
)
{
let
menuIds
=
[],
buttonIds
=
[],
buts
=
[],
mes
=
[];
let
menuIds
=
[],
buttonIds
=
[],
buts
=
[],
mes
=
[];
if
(
mobile
==
"1111111111"
)
{
if
(
mobile
==
"1111111111
1
"
)
{
buts
=
await
DB
.
Menu
.
find
({
del
:
0
}).
lean
().
exec
();
buts
=
await
DB
.
Menu
.
find
({
del
:
0
}).
lean
().
exec
();
mes
=
await
DB
.
Menu
.
find
({
del
:
0
,
type
:
1
,
enable
:
true
}).
populate
({
path
:
"parentIds"
}).
lean
().
exec
();
mes
=
await
DB
.
Menu
.
find
({
del
:
0
,
type
:
1
,
enable
:
true
}).
populate
({
path
:
"parentIds"
}).
lean
().
exec
();
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment