Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
app-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
app-service
Commits
efff13bc
Commit
efff13bc
authored
May 07, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善header
parent
475b761d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
CheckCustomToken.java
...a/com/esv/freight/app/common/filter/CheckCustomToken.java
+1
-1
FeignConfigure.java
src/main/java/com/esv/freight/app/config/FeignConfigure.java
+6
-2
VehicleForm.java
.../com/esv/freight/app/module/vehicle/form/VehicleForm.java
+6
-0
bootstrap.yml
src/main/resources/bootstrap.yml
+1
-1
No files found.
src/main/java/com/esv/freight/app/common/filter/CheckCustomToken.java
View file @
efff13bc
...
@@ -45,7 +45,7 @@ public class CheckCustomToken {
...
@@ -45,7 +45,7 @@ public class CheckCustomToken {
Long
tenantId
=
customToken
.
getTenantId
();
Long
tenantId
=
customToken
.
getTenantId
();
// TODO 判断租户ID是否正确,如果不存在此租户,直接返回,目前暂定租户名"100100100"
// TODO 判断租户ID是否正确,如果不存在此租户,直接返回,目前暂定租户名"100100100"
if
(
tenantId
!=
1
00100100
L
)
{
if
(
tenantId
!=
1L
)
{
throw
new
EException
(
401
,
"没有访问权限"
);
throw
new
EException
(
401
,
"没有访问权限"
);
}
}
...
...
src/main/java/com/esv/freight/app/config/FeignConfigure.java
View file @
efff13bc
package
com
.
esv
.
freight
.
app
.
config
;
package
com
.
esv
.
freight
.
app
.
config
;
import
com.esv.freight.app.common.util.ReqUtils
;
import
com.esv.freight.app.common.util.ReqUtils
;
import
com.esv.freight.app.common.util.SecurityUtils
;
import
com.esv.freight.app.module.account.CustomToken
;
import
com.esv.freight.app.module.account.CustomToken
;
import
com.esv.gateway.common.GatewayHeaders
;
import
com.esv.gateway.common.GatewayHeaders
;
import
feign.RequestInterceptor
;
import
feign.RequestInterceptor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.MDC
;
import
org.slf4j.MDC
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
...
@@ -24,6 +26,7 @@ import java.lang.reflect.Field;
...
@@ -24,6 +26,7 @@ import java.lang.reflect.Field;
*/
*/
@EnableFeignClients
(
basePackages
=
"com.esv.freight.app.feign"
)
@EnableFeignClients
(
basePackages
=
"com.esv.freight.app.feign"
)
@Configuration
@Configuration
@Slf4j
public
class
FeignConfigure
{
public
class
FeignConfigure
{
@Value
(
"${spring.application.name}"
)
@Value
(
"${spring.application.name}"
)
...
@@ -39,9 +42,10 @@ public class FeignConfigure {
...
@@ -39,9 +42,10 @@ public class FeignConfigure {
RequestInterceptor
requestInterceptor
=
((
requestTemplate
->
{
RequestInterceptor
requestInterceptor
=
((
requestTemplate
->
{
requestTemplate
.
header
(
"trace_id"
,
MDC
.
get
(
"traceId"
));
requestTemplate
.
header
(
"trace_id"
,
MDC
.
get
(
"traceId"
));
requestTemplate
.
header
(
"application_name"
,
applicationName
);
requestTemplate
.
header
(
"application_name"
,
applicationName
);
requestTemplate
.
header
(
"Source-Type"
,
"4"
);
String
requestSource
=
ReqUtils
.
getRequestHeader
(
"requestSource"
);
requestTemplate
.
header
(
"Source-Type"
,
requestSource
);
requestTemplate
.
header
(
"esv_data_perm"
,
"0"
);
requestTemplate
.
header
(
"esv_data_perm"
,
"0"
);
requestTemplate
.
header
(
"gateway_traceid"
,
"1"
);
//
requestTemplate.header("gateway_traceid", "1");
requestTemplate
.
header
(
"esv_system"
,
"app"
);
requestTemplate
.
header
(
"esv_system"
,
"app"
);
requestTemplate
.
header
(
"esv_department"
,
"5"
);
requestTemplate
.
header
(
"esv_department"
,
"5"
);
requestTemplate
.
header
(
"esv_department_children"
,
"5,6,7"
);
requestTemplate
.
header
(
"esv_department_children"
,
"5,6,7"
);
...
...
src/main/java/com/esv/freight/app/module/vehicle/form/VehicleForm.java
View file @
efff13bc
...
@@ -79,6 +79,12 @@ public class VehicleForm {
...
@@ -79,6 +79,12 @@ public class VehicleForm {
@Range
(
min
=
1000
,
max
=
5000
,
message
=
"参数vehicleHeight不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Range
(
min
=
1000
,
max
=
5000
,
message
=
"参数vehicleHeight不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@NotNull
(
message
=
"参数vehicleHeight不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
@NotNull
(
message
=
"参数vehicleHeight不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
Integer
vehicleHeight
;
private
Integer
vehicleHeight
;
/**
* 车辆所属(字典表):1-自有车、2-外协车
*/
@Range
(
min
=
1
,
max
=
2
,
message
=
"参数vehicleBelong不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@NotNull
(
message
=
"参数vehicleBelong不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
Integer
vehicleBelong
;
/**
/**
* 年审日期
* 年审日期
*/
*/
...
...
src/main/resources/bootstrap.yml
View file @
efff13bc
...
@@ -5,7 +5,7 @@ server:
...
@@ -5,7 +5,7 @@ server:
nacos
:
nacos
:
url
:
192.168.31.248:8848
url
:
192.168.31.248:8848
namespace
:
aad5aa26-5351-4e7a-a65e-ecb332f3c52c
namespace
:
aad5aa26-5351-4e7a-a65e-ecb332f3c52c
group
:
FREIGH
T_GROUP
group
:
DEFAUL
T_GROUP
spring
:
spring
:
application
:
application
:
name
:
freight-app-service
name
:
freight-app-service
...
...
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