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
debfe4ba
Commit
debfe4ba
authored
Mar 22, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
04bb7c64
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
56 deletions
+60
-56
cost.ts
src/biz/member/cost.ts
+0
-2
examine.ts
src/biz/member/examine.ts
+7
-1
homePage.ts
src/biz/member/homePage.ts
+2
-2
order.ts
src/biz/member/order.ts
+1
-1
cityConfig.ts
src/config/cityConfig.ts
+0
-0
errorEnum.ts
src/config/errorEnum.ts
+2
-1
router.ts
src/routers/member/router.ts
+1
-4
router.ts
src/routers/router.ts
+47
-45
No files found.
src/biz/member/cost.ts
View file @
debfe4ba
...
...
@@ -14,7 +14,6 @@ import { ERRORENUM } from "../../config/errorEnum";
import
{
generateWXOrderId
,
successResult
}
from
"../../tools/system"
;
import
{
updateOneData
}
from
"../../data/update"
;
import
moment
=
require
(
"moment"
);
import
{
createOrder
}
from
"./order"
;
const
AppId
=
'wx96c0cf11b3babcf6'
;
const
MchId
=
'1614605859'
;
...
...
@@ -97,7 +96,6 @@ export async function orderClose({id, weChartPR}) {
}
/**
* 微信回调函数【微信用】
*/
...
...
src/biz/member/examine.ts
View file @
debfe4ba
...
...
@@ -14,6 +14,7 @@ import { BizError } from "../../util/bizError";
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
import
{
createOrder
}
from
"./order"
;
import
{
getCityNameByCode
}
from
"../../config/cityConfig"
;
/**
* 待审核列表 success
...
...
@@ -47,6 +48,10 @@ export async function pendingReviewList({unitName, joinTime, memberType, sheng,
else
item
.
userRegisterState
=
changeEnumValue
(
USERREGISTERSTATE
,
item
.
userRegisterState
);
if
(
item
.
memberType
==
MEMBERTYPE
.
个人会员
)
item
.
unitName
=
item
.
workUnit
;
item
.
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
item
.
memberLevel
);
item
.
sheng
=
getCityNameByCode
(
item
.
sheng
);
item
.
shi
=
getCityNameByCode
(
item
.
shi
);
item
.
qu
=
getCityNameByCode
(
item
.
qu
);
dataList
.
push
(
item
);
});
...
...
@@ -121,7 +126,8 @@ export async function adopt({id, session}) {
* @param remarks 驳回理由
* @returns
*/
export
async
function
reject
({
userId
,
remarks
})
{
export
async
function
reject
({
id
,
remarks
})
{
let
userId
=
id
;
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
,
isAdmin
:
STATE
.
否
});
if
(
!
userInfo
||
!
userInfo
.
userId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
userInfo
.
memberType
==
MEMBERTYPE
.
个人会员
&&
userInfo
.
registerFlow
!=
REGISTERFLOW
.
完成第二步
)
{
...
...
src/biz/member/homePage.ts
View file @
debfe4ba
...
...
@@ -4,7 +4,7 @@
*/
import
moment
=
require
(
"moment"
);
import
{
BANXUELEIXING
,
DOCUMENTTYPE
,
INDIVIDUALMEMBERTYPE
,
INVOICESTATUS
,
MEMBERLEVEL
,
MEMBERTYPE
,
NATION
,
ORDERSTATE
,
PROFCATEGORY
,
SEX
,
STATE
,
UNITMEMBERTYPE
,
USERREGISTERSTATE
}
from
"../../config/enum"
;
import
{
MEMBERTYPE
,
STATE
,
UNITMEMBERTYPE
,
USERREGISTERSTATE
}
from
"../../config/enum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
addManyData
}
from
"../../data/add"
;
import
{
deleteManyData
}
from
"../../data/delete"
;
...
...
@@ -14,7 +14,7 @@ import { updateOneData } from "../../data/update";
import
{
generateSystemId
,
successResult
}
from
"../../tools/system"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
/**
...
...
src/biz/member/order.ts
View file @
debfe4ba
...
...
@@ -512,7 +512,7 @@ export async function getInvoiceStatus({id}) {
export
async
function
//
export async function
...
...
src/config/cityConfig.ts
0 → 100644
View file @
debfe4ba
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/config/errorEnum.ts
View file @
debfe4ba
...
...
@@ -44,7 +44,8 @@ export enum ERRORENUM {
不满足重新请求条件
,
该订单正在支付
,
微信支付回调错误
,
支付失败
支付失败
,
地址数据错误
}
export
enum
ERRORCODEENUM
{
...
...
src/routers/member/router.ts
View file @
debfe4ba
...
...
@@ -562,9 +562,6 @@ export const Config = {
adminType
:{
type
:
'Number'
,
desc
:
'管理员类别'
},
adminLv
:{
type
:
'[Number]'
,
desc
:
'管理员等级'
},
}
},
{
key
:
"userId"
,
type
:
"String"
,
desc
:
"登录用户id"
}
],
bindBiz
:
rightsMgmtBiz
.
addAdmin
...
...
@@ -591,7 +588,7 @@ export const Config = {
apiName
:
"修改权限"
,
subUrl
:
'/rightsmgmt/updatemgmt'
,
param
:[
{
key
:
"
userI
d"
,
type
:
"String"
,
desc
:
"登录用户id"
},
{
key
:
"
i
d"
,
type
:
"String"
,
desc
:
"登录用户id"
},
{
key
:
"adminLv"
,
type
:
"[Number]"
,
desc
:
"管理员等级"
},
],
bindBiz
:
rightsMgmtBiz
.
updateMGMT
...
...
src/routers/router.ts
View file @
debfe4ba
...
...
@@ -30,62 +30,64 @@ export async function setRouter(httpServer){
await
initDoc
(
orderRouter
.
FirstName
,
orderRouter
.
Config
,
orderRouter
.
FirstRouter
);
//会费相关
await
initDoc
(
costRouter
.
FirstName
,
costRouter
.
Config
,
costRouter
.
FirstRouter
);
//支付
}
a
wait
a
nalysisRouter
(
httpServer
,
portalRouter
.
Config
,
portalRouter
.
FirstRouter
,
false
);
//网站编辑
a
wait
a
nalysisRouter
(
httpServer
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
,
false
);
//公用组件
a
wait
a
nalysisRouter
(
httpServer
,
memberRouter
.
Config
,
memberRouter
.
FirstRouter
,
true
);
//用户路由
a
wait
a
nalysisRouter
(
httpServer
,
officalWebsiteRouter
.
Config
,
officalWebsiteRouter
.
FirstRouter
,
false
);
//官网路由
a
wait
a
nalysisRouter
(
httpServer
,
orderRouter
.
Config
,
orderRouter
.
FirstRouter
,
true
);
//会费相关
a
wait
a
nalysisRouter
(
httpServer
,
costRouter
.
Config
,
costRouter
.
FirstRouter
,
true
);
//支付
analysisRouter
(
httpServer
,
portalRouter
.
Config
,
portalRouter
.
FirstRouter
,
false
);
//网站编辑
analysisRouter
(
httpServer
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
,
false
);
//公用组件
analysisRouter
(
httpServer
,
memberRouter
.
Config
,
memberRouter
.
FirstRouter
,
true
);
//用户路由
analysisRouter
(
httpServer
,
officalWebsiteRouter
.
Config
,
officalWebsiteRouter
.
FirstRouter
,
false
);
//官网路由
analysisRouter
(
httpServer
,
orderRouter
.
Config
,
orderRouter
.
FirstRouter
,
true
);
//会费相关
analysisRouter
(
httpServer
,
costRouter
.
Config
,
costRouter
.
FirstRouter
,
true
);
//支付
}
async
function
analysisRouter
(
httpServer
,
config
,
firstRouter
,
haveMiddleware
)
{
function
analysisRouter
(
httpServer
,
config
,
firstRouter
,
haveMiddleware
)
{
for
(
let
modelKey
in
config
)
{
config
[
modelKey
].
forEach
(
info
=>
{
let
{
apiName
,
defaultParam
,
subUrl
,
param
,
bindBiz
,
notMiddleware
}
=
info
;
httpServer
.
post
(
firstRouter
+
subUrl
,
haveMiddleware
?
checkUser
:
notCheck
,
asyncHandler
(
async
function
(
req
,
res
)
{
let
chackObjectList
=
[];
let
checkStringMap
=
{};
let
stringNotMustHaveKeys
=
[];
let
funcParam
:
any
=
{};
funcParam
.
userId
=
req
.
headers
.
userId
;
for
(
let
i
=
0
;
i
<
param
.
length
;
i
++
)
{
let
info
:
any
=
param
[
i
];
let
{
key
,
type
}
=
param
[
i
];
if
(
info
.
isNull
)
stringNotMustHaveKeys
.
push
(
key
);
if
(
type
==
'Object'
)
{
chackObjectList
.
push
(
param
[
i
]);
checkStringMap
[
key
]
=
type
;
}
else
checkStringMap
[
key
]
=
type
;
}
/**校验参数 */
if
(
chackObjectList
.
length
)
{
chackObjectList
.
forEach
(
item
=>
{
if
(
!
req
.
body
[
item
.
key
])
throw
new
BizError
(
ERRORENUM
.
参数错误
,
`
${
apiName
}
`
,
`缺少参数
${
item
.
key
}
`
);
eccFormParam
(
apiName
,
item
.
sub
,
req
.
body
[
item
.
key
]);
funcParam
[
item
.
key
]
=
req
.
body
[
item
.
key
];
});
}
if
(
Object
.
keys
(
checkStringMap
).
length
)
{
let
eccResult
=
eccReqParamater
(
apiName
,
checkStringMap
,
req
.
body
,
stringNotMustHaveKeys
);
for
(
let
key
in
eccResult
)
{
funcParam
[
key
]
=
eccResult
[
key
];
}
}
if
(
defaultParam
)
funcParam
[
"defaultParam"
]
=
defaultParam
;
let
result
=
await
bindBiz
(
funcParam
);
res
.
success
(
result
);
}));
if
(
haveMiddleware
&&
!
notMiddleware
)
httpServer
.
post
(
firstRouter
+
subUrl
,
checkUser
,
asyncHandler
(
routerFun
(
apiName
,
defaultParam
,
subUrl
,
param
,
bindBiz
,
notMiddleware
)));
else
httpServer
.
post
(
firstRouter
+
subUrl
,
asyncHandler
(
routerFun
(
apiName
,
defaultParam
,
subUrl
,
param
,
bindBiz
,
notMiddleware
)));
});
}
}
function
routerFun
(
apiName
,
defaultParam
,
subUrl
,
param
,
bindBiz
,
notMiddleware
)
{
return
async
function
(
req
,
res
)
{
let
chackObjectList
=
[];
let
checkStringMap
=
{};
let
stringNotMustHaveKeys
=
[];
let
funcParam
:
any
=
{};
funcParam
.
userId
=
req
.
headers
.
userId
;
for
(
let
i
=
0
;
i
<
param
.
length
;
i
++
)
{
let
info
:
any
=
param
[
i
];
let
{
key
,
type
}
=
param
[
i
];
if
(
info
.
isNull
)
stringNotMustHaveKeys
.
push
(
key
);
if
(
type
==
'Object'
)
{
chackObjectList
.
push
(
param
[
i
]);
checkStringMap
[
key
]
=
type
;
}
else
checkStringMap
[
key
]
=
type
;
}
/**校验参数 */
if
(
chackObjectList
.
length
)
{
chackObjectList
.
forEach
(
item
=>
{
if
(
!
req
.
body
[
item
.
key
])
throw
new
BizError
(
ERRORENUM
.
参数错误
,
`
${
apiName
}
`
,
`缺少参数
${
item
.
key
}
`
);
eccFormParam
(
apiName
,
item
.
sub
,
req
.
body
[
item
.
key
]);
funcParam
[
item
.
key
]
=
req
.
body
[
item
.
key
];
});
}
if
(
Object
.
keys
(
checkStringMap
).
length
)
{
let
eccResult
=
eccReqParamater
(
apiName
,
checkStringMap
,
req
.
body
,
stringNotMustHaveKeys
);
for
(
let
key
in
eccResult
)
{
funcParam
[
key
]
=
eccResult
[
key
];
}
}
if
(
defaultParam
)
funcParam
[
"defaultParam"
]
=
defaultParam
;
let
result
=
await
bindBiz
(
funcParam
);
res
.
success
(
result
);
}
}
export
async
function
setAdditionalRouter
(
httpServer
)
{
...
...
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