如何解决如何从 Spring Cloud 中的服务中删除上下文路径?
我在 @Composable
fun GrayscaleImage() {
val context = AmbientContext.current
val image = remember {
val drawable = ContextCompat.getDrawable(
context,R.drawable.your_drawable
).toBitmap()!!.toGrayScale().asImageBitmap()
}
Image(image)
}
object Constants{
val grayPaint = android.graphics.Paint()
init {
val cm = ColorMatrix()
cm.setSaturation(0f)
val f = ColorMatrixColorFilter(cm)
grayPaint.colorFilter = f
}
}
fun Bitmap.toGrayscale(): Bitmap {
val height: Int = this.height
val width: Int = this.width
val bmpGrayscale: Bitmap = Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888)
val c = Canvas(bmpGrayscale)
c.drawBitmap(this,0f,Constants.grayPaint)
return bmpGrayscale
}
有一个 spring eureka 服务。配置yml文件如下:
192.168.3.8:8090
网关服务配置如下(服务器IP:192.168.3.7):
server:
port: 8090
spring:
application:
name: eureka-server
eureka:
client:
healthcheck:
enabled: true
registerWithEureka: false
fetchRegistry: false
service-url:
defaultZone: http://192.168.3.8:8090/eureka
我的应用服务正在 server:
port: 80
spring:
application:
name: gateway-service
cloud:
gateway:
discovery.locator:
enabled: true
lower-case-service-id: true
eureka:
instance:
prefer-ip-address: true
client:
service-url:
defaultZone: http://192.168.3.8:8090/eureka
management:
endpoint:
gateway:
enabled: true
service-registry:
enabled: true
endpoints:
web:
exposure:
include: gateway
运行。配置如下:
http://192.168.1.115:8090/Geoportal-Service-1.4.1
application:
name: geoportal-service
server:
port: 8090
eureka:
client:
service-url:
defaultZone: http://192.168.3.8:8090/eureka
instance:
hostname: 192.168.1.115
non-secure-port: ${server.port}
prefer-ip-address: true
spring:
cloud:
config:
discovery:
enabled: true
的路由示例是 Geoportal-Service-1.4.1
。现在我可以从地址 http://192.168.1115:8090/Geoportal-Service-1.4.1/info
的网关访问此路由,但我想通过地址 http://192.168.3.7/geoportal-service/Geoportal-Service-1.4.1/info
访问它。
如何修复此配置?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。