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
45167fe0
Commit
45167fe0
authored
Feb 07, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
926b2512
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
13 deletions
+27
-13
serverConfig.xml
serverConfig.xml
+1
-1
user.ts
src/biz/fuHuqQi/user.ts
+20
-3
errorEnum.ts
src/config/errorEnum.ts
+2
-1
fuhuaqi.ts
src/data/fuHuaQi/fuhuaqi.ts
+2
-0
dbInit.ts
src/db/dbInit.ts
+2
-2
main.ts
src/main.ts
+0
-6
No files found.
serverConfig.xml
View file @
45167fe0
<config>
<config>
<port>
30001
</port>
<port>
7077
</port>
<mongodb>
<mongodb>
<path>
127.0.0.1
</path>
<path>
127.0.0.1
</path>
<port>
27017
</port>
<port>
27017
</port>
...
...
src/biz/fuHuqQi/user.ts
View file @
45167fe0
...
@@ -15,8 +15,7 @@ import { getPwdMd5 } from "../../util/tools";
...
@@ -15,8 +15,7 @@ import { getPwdMd5 } from "../../util/tools";
* @param pwd 密码
* @param pwd 密码
* @returns fuhuaqiUserInfo:{uscc, name} 登录后的信息
* @returns fuhuaqiUserInfo:{uscc, name} 登录后的信息
*/
*/
export
async
function
login
(
uscc
:
string
,
pwd
:
string
):
Promise
<
object
>
{
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
);
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUscc
(
uscc
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
...
@@ -30,6 +29,25 @@ export async function login(uscc:string, pwd:string):Promise<object> {
...
@@ -30,6 +29,25 @@ export async function login(uscc:string, pwd:string):Promise<object> {
return
fuhuaqiUserInfo
;
return
fuhuaqiUserInfo
;
}
}
/**
* 首次登录修改密码
* @param uscc 孵化器统一信用代码
* @param pwd 新密码p
* @param confirmPwd 确认密码
* @returns
*/
export
async
function
firstLoginChangePwd
(
uscc
:
string
,
pwd
:
string
,
confirmPwd
:
string
)
{
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
dataBaseInfo
.
firstLoginIsChangePwd
)
throw
new
BizError
(
ERRORENUM
.
不能重复修改密码
,
`重复调用了首次登录之后的修改密码接口
${
uscc
}
`
);
//todo 校验密码
dataBaseInfo
.
pwd
=
pwd
;
await
dataBaseInfo
.
save
();
return
{
isSuccess
:
true
};
}
/**
/**
* 重置密码
* 重置密码
* @param uscc 信用代码
* @param uscc 信用代码
...
@@ -38,7 +56,6 @@ export async function login(uscc:string, pwd:string):Promise<object> {
...
@@ -38,7 +56,6 @@ export async function login(uscc:string, pwd:string):Promise<object> {
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
changePassword
(
uscc
:
string
,
pwd
:
string
,
newPwd
:
string
)
{
export
async
function
changePassword
(
uscc
:
string
,
pwd
:
string
,
newPwd
:
string
)
{
if
(
typeof
uscc
!=
"string"
||
typeof
pwd
!=
"string"
||
typeof
newPwd
!=
"string"
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
uscc
,
pwd
,
newPwd
);
let
reg
=
new
RegExp
(
"[`~!@#$^&*()=|{}':;',
\\
[
\\
].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"
);
let
reg
=
new
RegExp
(
"[`~!@#$^&*()=|{}':;',
\\
[
\\
].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"
);
if
(
reg
.
test
(
newPwd
))
{
if
(
reg
.
test
(
newPwd
))
{
throw
new
BizError
(
ERRORENUM
.
密码不允许有特殊字符
);
throw
new
BizError
(
ERRORENUM
.
密码不允许有特殊字符
);
...
...
src/config/errorEnum.ts
View file @
45167fe0
...
@@ -10,7 +10,8 @@ export enum ERRORENUM {
...
@@ -10,7 +10,8 @@ export enum ERRORENUM {
该企业当月数据已存在
,
该企业当月数据已存在
,
该报表需要填写本月内容后提交
,
该报表需要填写本月内容后提交
,
密码错误
,
密码错误
,
密码不允许有特殊字符
密码不允许有特殊字符
,
不能重复修改密码
}
}
export
enum
ERRORCODEENUM
{
export
enum
ERRORCODEENUM
{
...
...
src/data/fuHuaQi/fuhuaqi.ts
View file @
45167fe0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
* 孵化器信息表
* 孵化器信息表
* operationName不可修改 2023-02-06 确定此需求
* operationName不可修改 2023-02-06 确定此需求
* uscc不可修改 2023-02-06 确定此需求
* uscc不可修改 2023-02-06 确定此需求
* 首次登录要求改密码 不改密码不能继续操作 2023-02-07 确定此需求
*/
*/
import
{
Schema
}
from
'mongoose'
;
import
{
Schema
}
from
'mongoose'
;
...
@@ -10,6 +11,7 @@ import { baseDB } from '../../db/dbInit';
...
@@ -10,6 +11,7 @@ import { baseDB } from '../../db/dbInit';
const
fuHuaQiSchema
=
new
Schema
({
const
fuHuaQiSchema
=
new
Schema
({
name
:
{
type
:
String
,
index
:
true
},
//名称
name
:
{
type
:
String
,
index
:
true
},
//名称
pwd
:
String
,
//登录密码
pwd
:
String
,
//登录密码
firstLoginIsChangePwd
:{
type
:
Boolean
,
default
:
false
},
//首次登录是否修改密码
operationName
:
String
,
//运营机构名称 不可修改
operationName
:
String
,
//运营机构名称 不可修改
uscc
:{
type
:
String
,
index
:
true
},
//统一信用代码 也是登录账号 不可修改
uscc
:{
type
:
String
,
index
:
true
},
//统一信用代码 也是登录账号 不可修改
virtualEnterpriseNum
:
Number
,
//虚拟企业数量
virtualEnterpriseNum
:
Number
,
//虚拟企业数量
...
...
src/db/dbInit.ts
View file @
45167fe0
...
@@ -8,13 +8,13 @@ var baseDB;
...
@@ -8,13 +8,13 @@ var baseDB;
export
async
function
initDB
()
{
export
async
function
initDB
()
{
//如果配置了mongoServerConstVal 才会连接mongo
//如果配置了mongoServerConstVal 才会连接mongo
if
(
systemConfig
.
mongodbStr
)
{
if
(
systemConfig
.
mongodbStr
)
{
console
.
log
(
systemConfig
.
mongodbStr
)
console
.
log
(
systemConfig
.
mongodbStr
,
' 连接成功'
)
baseDB
=
await
createDbConnect
(
systemConfig
.
mongodbStr
).
catch
(
err
=>
{
baseDB
=
await
createDbConnect
(
systemConfig
.
mongodbStr
).
catch
(
err
=>
{
throw
err
throw
err
});
});
await
initTable
();
await
initTable
();
console
.
log
(
'
init mongodb
success'
);
console
.
log
(
'
mongodb init
success'
);
}
else
{
}
else
{
throw
new
BizError
(
"xml中未配置mongo连接字符串 无法连接到mongodb"
);
throw
new
BizError
(
"xml中未配置mongo连接字符串 无法连接到mongodb"
);
}
}
...
...
src/main.ts
View file @
45167fe0
...
@@ -8,11 +8,6 @@ async function lanuch() {
...
@@ -8,11 +8,6 @@ async function lanuch() {
await
initDB
();
await
initDB
();
httpServer
.
createServer
(
systemConfig
.
port
);
httpServer
.
createServer
(
systemConfig
.
port
);
console
.
log
(
'This indicates that the server is started successfully.'
);
console
.
log
(
'This indicates that the server is started successfully.'
);
// await t();
}
async
function
t
()
{
await
fuHuaQiTaskList
(
'111'
);
}
}
lanuch
();
lanuch
();
\ No newline at end of file
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