Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjxcxServer
Overview
Overview
Details
Activity
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
node_server
zjxcxServer
Commits
c02e08fa
Commit
c02e08fa
authored
Feb 06, 2023
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9e346ab2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
user.ts
src/biz/fuHuqQi/user.ts
+37
-0
fuhuaqi.ts
src/data/fuHuaQi/fuhuaqi.ts
+1
-0
No files found.
src/biz/fuHuqQi/user.ts
View file @
c02e08fa
...
@@ -3,3 +3,39 @@
...
@@ -3,3 +3,39 @@
* 主要包括有 孵化器账号的登录
* 主要包括有 孵化器账号的登录
* 预留好 重置密码 退出登录 接口
* 预留好 重置密码 退出登录 接口
*/
*/
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
import
{
BizError
}
from
"../../util/bizError"
;
const
md5
=
require
(
"md5"
);
//登录
export
async
function
login
(
uscc
:
string
,
pwd
:
string
)
{
if
(
typeof
uscc
!=
"string"
||
typeof
pwd
!=
"string"
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
uscc
,
pwd
);
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
let
checkPwd
=
getPwdMd5
(
fuhuaqiInfo
.
uscc
,
pwd
);
if
(
fuhuaqiInfo
.
pwd
!=
checkPwd
)
throw
new
BizError
(
"密码不正确"
);
let
fuhuaqiUserInfo
=
{
uscc
:
fuhuaqiInfo
.
uscc
,
name
:
fuhuaqiInfo
.
name
};
return
fuhuaqiUserInfo
;
}
//重置密码
//退出登录
export
async
function
logout
(
uscc
:
string
)
{
if
(
typeof
uscc
!=
"string"
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
uscc
);
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
await
fuhuaqiInfo
.
save
();
return
{
isOk
:
true
};
}
function
getPwdMd5
(
uscc
:
string
,
pwd
:
string
)
{
return
md5
(
uscc
+
pwd
);
}
\ No newline at end of file
src/data/fuHuaQi/fuhuaqi.ts
View file @
c02e08fa
...
@@ -38,3 +38,4 @@ export async function findFuHuaQiByUSCC(uscc:string) {
...
@@ -38,3 +38,4 @@ export async function findFuHuaQiByUSCC(uscc:string) {
export
async
function
findFuHuaQiByName
(
name
:
string
)
{
export
async
function
findFuHuaQiByName
(
name
:
string
)
{
return
await
fuHuaQiModel
.
findOne
({
name
}).
exec
();
return
await
fuHuaQiModel
.
findOne
({
name
}).
exec
();
}
}
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