Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wenHuaBu_adminServer
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
wenHuaBu_adminServer
Commits
fb6ead6d
Commit
fb6ead6d
authored
Apr 11, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
77c01fcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
user.ts
src/biz/member/user.ts
+1
-1
register.ts
src/biz/register.ts
+7
-3
No files found.
src/biz/member/user.ts
View file @
fb6ead6d
...
...
@@ -37,7 +37,7 @@ export async function login({loginId, pwd}) {
let
token
=
""
;
const
Now
=
new
Date
().
valueOf
();
if
(
userInfo
.
isAdmin
==
STATE
.
是
||
(
userInfo
.
userRegisterState
==
USERREGISTERSTATE
.
通过
&&
userInfo
.
isAdmin
==
STATE
.
否
))
{
if
(
userInfo
.
isAdmin
==
STATE
.
是
||
(
userInfo
.
userRegisterState
!=
USERREGISTERSTATE
.
驳回修改
&&
userInfo
.
isAdmin
==
STATE
.
否
))
{
token
=
generateToken
(
userInfo
.
userId
);
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
userInfo
.
userId
},
{
token
,
tokenMs
:
Now
,
lastLoginMs
:
Now
});
}
...
...
src/biz/register.ts
View file @
fb6ead6d
...
...
@@ -45,6 +45,7 @@ export async function memberRegister1({form}) {
/**初始化账号信息 */
let
userId
=
sysTools
.
generateUserId
();
//系统生成唯一id
let
token
=
sysTools
.
generateToken
(
userId
);
let
addInfo
=
{
userId
,
memberType
:
MEMBERTYPE
.
个人会员
,
...
...
@@ -52,12 +53,13 @@ export async function memberRegister1({form}) {
registerFlow
:
REGISTERFLOW
.
完成第一步
,
//会员注册流程状态
askForTime
:
NowMs
,
//申请时间
loginId
,
mail
,
pwd
,
phone
,
token
};
await
addOneData
(
TABLEENUM
.
用户表
,
addInfo
);
await
updateOneData
(
TABLEENUM
.
验证码表
,
{
phone
,
code
:
codeNum
,
isUse
:
false
},
{
isUse
:
true
});
return
{
userId
}
return
{
userId
,
token
}
}
...
...
@@ -138,6 +140,7 @@ export async function memberRegister2({form, id}) {
/**初始化账号信息 */
let
userId
=
sysTools
.
generateUserId
();
let
token
=
sysTools
.
generateToken
(
userId
);
let
addInfo
=
{
userId
,
memberType
:
MEMBERTYPE
.
单位会员
,
...
...
@@ -147,14 +150,15 @@ export async function memberRegister2({form, id}) {
loginId
,
mail
,
pwd
,
phone
phone
,
token
};
await
addOneData
(
TABLEENUM
.
用户表
,
addInfo
);
/**修改验证码状态为已使用 */
await
updateOneData
(
TABLEENUM
.
验证码表
,
{
phone
,
code
:
codeNum
,
isUse
:
false
},
{
isUse
:
true
});
return
{
userId
};
return
{
userId
,
token
};
}
...
...
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