Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lcj-btp-java-app
Project
Project
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
郭智朋
lcj-btp-java-app
Commits
5dcf9a62
Commit
5dcf9a62
authored
Feb 17, 2025
by
guozhipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部署文件优化
parent
95bcea84
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
17 deletions
+42
-17
mtaDeploy.sh
mtaDeploy.sh
+38
-0
OperateAuthFilter.java
...stomer/lianchuangjie/common/filter/OperateAuthFilter.java
+2
-2
mta-from.yaml
tools/mtaFile/pre/mta-from.yaml
+2
-15
No files found.
mtaDeploy.sh
View file @
5dcf9a62
...
@@ -138,6 +138,39 @@ progressBar(){
...
@@ -138,6 +138,39 @@ progressBar(){
printf
"
\n
"
printf
"
\n
"
}
}
#部署文件添加模块
addMtaModules
(){
# 要操作的文件名
file
=
"mta.yaml"
# 指定目录
# 获取当前脚本的完整路径
SCRIPT_PATH
=
$(
readlink
-f
"
$0
"
)
# java根目录
directory
=
$(
dirname
${
SCRIPT_PATH
})
/app
insert_text
=
"#modules name
\n
"
insert_text2
=
"#requires name
\n
"
routeStr
=
"router"
for
item
in
"
$directory
"
/
*
;
do
name
=
$(
basename
"
$item
"
)
if
[
-d
"
$item
"
]
;
then
# 使用 if 语句判断字符串是否与变量相等
if
[
"
$name
"
=
"
$routeStr
"
]
;
then
echo
"
$name
相等"
else
echo
"
$name
不相等"
insert_text
=
"
$insert_text
- name:
$name
\n
type: html5
\n
path: app/
$name
\n
build-parameters:
\n
builder: custom
\n
commands:
\n
- npm run build
\n
supported-platforms:
\n
[ ]
\n
build-result: .
\n
"
insert_text2
=
"
$insert_text2
- name:
$name
\n
artifacts:
\n
- './*'
\n
target-path:
$name
\n
"
fi
fi
done
# 要插入的文本
# 使用sed命令进行插入操作
sed
-i
"/insert_modules_name/a
${
insert_text
}
"
$file
sed
-i
"/insert_requires_name/a
${
insert_text2
}
"
$file
}
#公共接口
#公共接口
common
(){
common
(){
logo
#logo加载
logo
#logo加载
...
@@ -211,6 +244,11 @@ common(){
...
@@ -211,6 +244,11 @@ common(){
cat
${
xsSecurityFrom
}
>
${
xsSecurity
}
cat
${
xsSecurityFrom
}
>
${
xsSecurity
}
cat
${
cdsrcPrivateFrom
}
>
${
cdsrcPrivate
}
cat
${
cdsrcPrivateFrom
}
>
${
cdsrcPrivate
}
echo
-e
"
\0
33[30;42m 添加模块中,请稍后。。。
\0
33[0m"
starttime101
=
`
date
+%s
`
secondsToTime
${
starttime
}
${
starttime101
}
addMtaModules
#删除部署文件
#删除部署文件
echo
-e
"
\0
33[30;42m rm -rf gen/mta.mtar 部署文件删除中,请稍后。。。
\0
33[0m"
echo
-e
"
\0
33[30;42m rm -rf gen/mta.mtar 部署文件删除中,请稍后。。。
\0
33[0m"
starttime10
=
`
date
+%s
`
starttime10
=
`
date
+%s
`
...
...
srv/src/main/java/customer/lianchuangjie/common/filter/OperateAuthFilter.java
View file @
5dcf9a62
...
@@ -212,7 +212,7 @@ public class OperateAuthFilter implements Filter {
...
@@ -212,7 +212,7 @@ public class OperateAuthFilter implements Filter {
writeResult
(
response
,
wrapResult
);
writeResult
(
response
,
wrapResult
);
return
;
return
;
}
}
/*
if (request.getMethod().equals("GET") && ("/index.html".equals(uri))) {// "/index.html"跳转到"/"
if
(
request
.
getMethod
().
equals
(
"GET"
)
&&
(
"/index.html"
.
equals
(
uri
)))
{
// "/index.html"跳转到"/"
response
.
setHeader
(
"Cache-Control"
,
"no-cache, no-store, must-revalidate"
);
response
.
setHeader
(
"Cache-Control"
,
"no-cache, no-store, must-revalidate"
);
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
response
.
setHeader
(
"Expires"
,
"0"
);
response
.
setHeader
(
"Expires"
,
"0"
);
...
@@ -225,7 +225,7 @@ public class OperateAuthFilter implements Filter {
...
@@ -225,7 +225,7 @@ public class OperateAuthFilter implements Filter {
response
.
setHeader
(
"Expires"
,
"0"
);
response
.
setHeader
(
"Expires"
,
"0"
);
request
.
getServletContext
().
getRequestDispatcher
(
"/index.html"
).
forward
(
request
,
response
);
//重定向
request
.
getServletContext
().
getRequestDispatcher
(
"/index.html"
).
forward
(
request
,
response
);
//重定向
return
;
return
;
}
*/
}
boolean
allowUri
=
Pattern
.
matches
(
"(.*/login/.*|.*/odata/v4/.*)"
,
uri
);
boolean
allowUri
=
Pattern
.
matches
(
"(.*/login/.*|.*/odata/v4/.*)"
,
uri
);
//排除用户登录和非Post请求
//排除用户登录和非Post请求
if
(!
allowUri
&&
request
.
getMethod
().
equals
(
"POST"
))
{
if
(!
allowUri
&&
request
.
getMethod
().
equals
(
"POST"
))
{
...
...
tools/mtaFile/pre/mta-from.yaml
View file @
5dcf9a62
...
@@ -52,17 +52,7 @@ modules:
...
@@ -52,17 +52,7 @@ modules:
requires
:
requires
:
-
name
:
lianchuangjie-pre-db
-
name
:
lianchuangjie-pre-db
-
name
:
orders
#insert_modules_name
type
:
html5
path
:
app/orders
build-parameters
:
builder
:
custom
commands
:
-
npm run build
supported-platforms
:
[
]
build-result
:
.
-
name
:
lianchuangjie-pre
-
name
:
lianchuangjie-pre
type
:
approuter.nodejs
type
:
approuter.nodejs
path
:
app\router
path
:
app\router
...
@@ -82,10 +72,7 @@ modules:
...
@@ -82,10 +72,7 @@ modules:
-
name
:
lianchuangjie-pre-auth
-
name
:
lianchuangjie-pre-auth
build-parameters
:
build-parameters
:
requires
:
requires
:
-
name
:
orders
#insert_requires_name
artifacts
:
-
'
./*'
target-path
:
orders
provides
:
provides
:
-
name
:
app-api
-
name
:
app-api
properties
:
properties
:
...
...
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