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
2e9f11d9
Commit
2e9f11d9
authored
Apr 08, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
086a79fd
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
114 additions
and
19 deletions
+114
-19
officialWebsite.ts
src/biz/officialWebsite.ts
+25
-5
oss.ts
src/biz/oss.ts
+35
-0
wenZhangGuanLi.ts
src/biz/portal/neiRongGuanLi/wenZhangGuanLi.ts
+5
-6
enum.ts
src/config/enum.ts
+6
-3
select.ts
src/data/select.ts
+1
-1
http_server.ts
src/net/http_server.ts
+1
-0
router.ts
src/routers/member/router.ts
+15
-3
router.ts
src/routers/officalWebsite/router.ts
+8
-0
router.ts
src/routers/public/router.ts
+7
-0
router.ts
src/routers/router.ts
+1
-1
verificationParam.ts
src/util/verificationParam.ts
+10
-0
No files found.
src/biz/officialWebsite.ts
View file @
2e9f11d9
...
...
@@ -24,7 +24,7 @@ export async function banner() {
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
let
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
,
id
:
articleTitle
});
}
return
result
;
}
...
...
@@ -108,7 +108,7 @@ export async function xueHuiGaiKuangBanner() {
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
let
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
,
id
:
articleTitle
});
}
return
result
;
}
...
...
@@ -269,7 +269,7 @@ export async function pinPaiXiangMuBanner() {
let
articleInfo
=
await
findOnce
(
TABLEENUM
.
文章管理
,
{
id
:
articleTitle
},
[
"id"
,
"title"
]);
let
articleTitleStr
=
articleInfo
&&
articleInfo
.
id
?
articleInfo
.
title
:
''
;
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitleStr
,
desc
,
articleUrl
,
id
:
articleTitle
});
}
return
result
;
}
...
...
@@ -297,7 +297,7 @@ export async function pinPaiXiangMu() {
});
/**芳华杯 */
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
芳华杯
];
let
fangHuaBeiData
=
await
findToSort
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
},
{
articleTime
:
-
1
}
);
let
fangHuaBeiData
=
await
findToSort
ToPage
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
},[
"id"
,
"title"
,
"imgUrl"
,
"articleTime"
,
"desc"
],
{
articleTime
:
-
1
},
1
,
10
);
fangHuaBeiData
.
forEach
(
info
=>
{
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
result
.
fangHuaBei
.
push
({
...
...
@@ -326,6 +326,26 @@ export async function pinPaiXiangMu() {
/**
* 芳华杯 更多
*/
export
async
function
fangHuaBei
({
pageNumber
})
{
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
芳华杯
]},
display
:
STATE
.
是
};
let
dataBaseList
=
await
findToSortToPage
(
TABLEENUM
.
文章管理
,
findParam
,
[],
{
articleTime
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
文章管理
,
findParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
{
id
,
title
,
desc
,
imgUrl
,
articleTime
}
=
info
;
dataList
.
push
({
id
,
title
,
desc
,
imgUrl
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
)
});
});
return
{
dataList
,
dataCount
};
}
/**
* 学术研究列表
* @param param0
* @returns
...
...
@@ -446,7 +466,7 @@ export async function dangJianZiYuan({first, secondary, three, pageNumber}) {
dataCount
=
await
findCount
(
TABLEENUM
.
文章管理
,
findParam
);
dataBaseList
.
forEach
(
item
=>
{
let
{
title
,
desc
,
articleTime
,
imgUrl
,
id
}
=
item
;
dataList
.
push
({
id
,
title
,
desc
,
articleTime
,
imgUrl
});
dataList
.
push
({
id
,
title
,
desc
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
)
,
imgUrl
});
});
}
else
{
//学习园地
if
(
secondary
==
PARTYBUILDSUBTYPEENUM
.
文字资料
)
{
...
...
src/biz/oss.ts
0 → 100644
View file @
2e9f11d9
import
moment
=
require
(
"moment"
);
import
{
FILEDIRECTORY
,
OOSCODE
}
from
"../config/enum"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../util/verificationEnum"
;
const
Crypto
=
require
(
'crypto'
);
const
AssertsKey
=
'sbPR0AdDPfjm7v2NSffk5apPm6UClV'
;
const
OSSAccessKeyId
=
'LTAI5tD7Finu3fxFMCi3415S'
;
export
function
getOss
({
userId
,
type
,
fileName
})
{
let
limitMstime
=
moment
().
add
(
5
,
'minute'
).
utc
().
format
();
eccEnumValue
(
"获取OSS授权"
,
"类型"
,
OOSCODE
,
type
);
var
policyText
=
{
"expiration"
:
limitMstime
,
//设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了
"conditions"
:
[
[
"content-length-range"
,
0
,
524288000
]
// 设置上传文件的大小限制
]
};
let
policyBase64
=
Buffer
.
from
(
JSON
.
stringify
(
policyText
)).
toString
(
'base64'
);
const
FirName
=
FILEDIRECTORY
[
changeEnumValue
(
OOSCODE
,
type
)];
let
message
=
policyBase64
;
let
hmac
=
Crypto
.
createHmac
(
'sha1'
,
AssertsKey
);
hmac
.
update
(
message
);
let
signature
=
hmac
.
digest
(
'base64'
);
// let bytes = Crypto.HMAC(Crypto.SHA1, message, AssertsKey, { asBytes: true });
// var signature = Crypto.util.bytesToBase64(hmacDigest);
return
{
OSSAccessKeyId
:
OSSAccessKeyId
,
dirName
:
`
${
userId
}
/
${
FirName
}
/
${
new
Date
().
valueOf
()}
`
,
policyBase64
,
host
:
'http://wenhuabu-files.oss-cn-beijing.aliyuncs.com'
,
signature
};
}
\ No newline at end of file
src/biz/portal/neiRongGuanLi/wenZhangGuanLi.ts
View file @
2e9f11d9
...
...
@@ -13,8 +13,6 @@ import { updateOneData } from "../../../data/update";
import
{
changeArticleName
,
generateSystemId
,
successResult
}
from
"../../../tools/system"
;
import
{
BizError
}
from
"../../../util/bizError"
;
import
{
extractData
}
from
"../../../util/piecemeal"
;
import
{
changeEnumValue
}
from
"../../../util/verificationEnum"
;
import
{
wenZhangQueue
}
from
"../../task"
;
/**
...
...
@@ -68,8 +66,8 @@ export async function list(secureArgs:any) {
if
(
title
)
selectParam
.
title
=
title
;
if
(
articleTime
)
{
selectParam
[
"$and"
]
=
[
{
video
Time
:{
"$gt"
:
articleTime
}},
{
video
Time
:{
"$lt"
:
articleTime
+
(
24
*
3600
*
1000
)}}
{
article
Time
:{
"$gt"
:
articleTime
}},
{
article
Time
:{
"$lt"
:
articleTime
+
(
24
*
3600
*
1000
)}}
];
}
...
...
@@ -128,4 +126,6 @@ export async function getTitleList({type}) {
//todo
export
async
function
statsWenZhangCount
(
type
:
number
)
{
}
\ No newline at end of file
}
src/config/enum.ts
View file @
2e9f11d9
...
...
@@ -638,16 +638,19 @@ export enum OOSCODE {
学会概况
,
学会领导
,
学术研究
,
文字资料
,
文字资料
=
5
,
机构管理
logo
,
机构动态
,
机构下载专区
,
banner
,
文章管理
,
文章管理
=
10
,
视频管理
,
视频管理封面
,
线下付款转账截图
,
会费发票
会费发票
,
个人会员详情
=
15
,
单位会员详情
,
注册信息
}
src/data/select.ts
View file @
2e9f11d9
...
...
@@ -11,7 +11,7 @@ export async function findToPage(tableEnumValue:string, param:object, files:obje
}
export
async
function
findToSortToPage
(
tableEnumValue
:
string
,
param
:
object
,
files
:
object
,
sortParam
,
pageNumber
:
number
,
pageSize
?)
{
pageSize
=
pageSize
||
10
;
//默认每页10个
let
data
=
await
dataModels
[
tableEnumValue
].
find
(
param
,
files
).
sort
(
sortParam
).
skip
((
pageNumber
-
1
)
*
pageSize
).
limit
(
pageSize
);
return
data
;
...
...
src/net/http_server.ts
View file @
2e9f11d9
...
...
@@ -26,6 +26,7 @@ export class httpServer {
// next();
// }
});
// httpServer.use(bodyParser.json({limit:'5mb'}));
// httpServer.use(bodyParser.urlencoded({limit:'5mb', extends:true}));
...
...
src/routers/member/router.ts
View file @
2e9f11d9
...
...
@@ -6,6 +6,7 @@ import * as authorityBiz from "../../biz/member/authority";
import
*
as
registerBiz
from
"../../biz/register"
;
import
*
as
homePageBiz
from
"../../biz/member/homePage"
;
import
*
as
rightsMgmtBiz
from
"../../biz/member/rightsMgmt"
;
import
*
as
ossBiz
from
"../../biz/oss"
;
export
const
FirstName
=
'会员管理路由'
;
export
const
FirstRouter
=
'/manage/member'
;
...
...
@@ -32,7 +33,7 @@ export const Config = {
},
{
apiName
:
"个人入会流程2"
,
notMiddleware
:
tru
e
,
notMiddleware
:
fals
e
,
subUrl
:
'/memberdb/memberregister2'
,
param
:[
{
...
...
@@ -92,7 +93,7 @@ export const Config = {
},
{
apiName
:
"单位入会流程2"
,
notMiddleware
:
tru
e
,
notMiddleware
:
fals
e
,
subUrl
:
'/memberdb/unitmemberregister2'
,
param
:[
{
...
...
@@ -141,7 +142,7 @@ export const Config = {
},
{
apiName
:
"单位入会流程3"
,
notMiddleware
:
tru
e
,
notMiddleware
:
fals
e
,
subUrl
:
'/memberdb/unitmemberregister3'
,
param
:[
{
...
...
@@ -810,6 +811,17 @@ export const Config = {
],
bindBiz
:
homePageBiz
.
getCertificate
}
],
"oss授权"
:[
{
apiName
:
"获取oss授权必要参数"
,
subUrl
:
'/oss/info'
,
param
:[
{
key
:
"type"
,
type
:
"Number"
,
desc
:
"文件上传类型"
}
],
bindBiz
:
ossBiz
.
getOss
},
]
}
src/routers/officalWebsite/router.ts
View file @
2e9f11d9
...
...
@@ -112,6 +112,14 @@ export const Config = {
],
bindBiz
:
officialWebsiteBiz
.
xiangCunZhenXing
},
{
apiName
:
"芳华杯列表"
,
subUrl
:
"/fanghuabei"
,
param
:[
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"单前页"
}
],
bindBiz
:
officialWebsiteBiz
.
fangHuaBei
}
],
"党建工作"
:[
{
...
...
src/routers/public/router.ts
View file @
2e9f11d9
...
...
@@ -218,6 +218,13 @@ export const Config = {
param
:[],
defaultParam
:
enumConfig
.
XUEHUILINGDAOZHIWEI
,
bindBiz
:
publicBiz
.
setEnumInterface
},
{
apiName
:
"上传文件类别"
,
subUrl
:
'/uptype'
,
param
:[],
defaultParam
:
enumConfig
.
OOSCODE
,
bindBiz
:
publicBiz
.
setEnumInterface
}
],
...
...
src/routers/router.ts
View file @
2e9f11d9
...
...
@@ -30,7 +30,7 @@ export async function setRouter(httpServer){
// await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
// await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
}
analysisRouter
(
httpServer
,
portalRouter
.
Config
,
portalRouter
.
FirstRouter
,
fals
e
);
//网站编辑
analysisRouter
(
httpServer
,
portalRouter
.
Config
,
portalRouter
.
FirstRouter
,
tru
e
);
//网站编辑
analysisRouter
(
httpServer
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
,
false
);
//公用组件
analysisRouter
(
httpServer
,
memberRouter
.
Config
,
memberRouter
.
FirstRouter
,
true
);
//用户路由
analysisRouter
(
httpServer
,
officalWebsiteRouter
.
Config
,
officalWebsiteRouter
.
FirstRouter
,
false
);
//官网路由
...
...
src/util/verificationParam.ts
View file @
2e9f11d9
...
...
@@ -59,6 +59,16 @@ export function eccFormParam(name:string, keyTypeConf:object, param:object) {
}
}
break
;
case
'[String]'
:
if
(
!
Array
.
isArray
(
param
[
key
])
)
isError
=
true
;
for
(
let
i
=
0
;
i
<
param
[
key
].
length
;
i
++
)
{
let
item
=
param
[
key
][
i
];
if
(
typeof
item
!=
'string'
)
{
isError
=
true
;
errorStr
=
`
${
key
}
应是string型数组其中下标
${
i
}
是
${
typeof
item
}
`
;
}
}
break
;
case
'[Object]'
:
if
(
!
Array
.
isArray
(
param
[
key
])
)
isError
=
true
;
for
(
let
i
=
0
;
i
<
param
[
key
].
length
;
i
++
)
{
...
...
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