-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 支持websocket #2494 #2514
Open
yaoxuwan
wants to merge
1
commit into
TencentBlueKing:master
Choose a base branch
from
yaoxuwan:issue_2494
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: 支持websocket #2494 #2514
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED " AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
dependencies { | ||
api(project(":common:common-stream")) | ||
api(project(":common:common-service")) | ||
api(project(":common:common-artifact:artifact-service")) | ||
implementation("org.springframework.boot:spring-boot-starter-websocket") | ||
implementation("javax.websocket:javax.websocket-api") | ||
implementation("io.undertow:undertow-servlet") | ||
implementation("io.undertow:undertow-websockets-jsr") | ||
} |
48 changes: 48 additions & 0 deletions
48
.../biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/config/WebSocketConfigurer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.websocket.config | ||
|
||
import com.tencent.bkrepo.common.artifact.config.ArtifactConfigurerSupport | ||
import com.tencent.bkrepo.common.artifact.pojo.RepositoryType | ||
import com.tencent.bkrepo.common.artifact.repository.local.LocalRepository | ||
import com.tencent.bkrepo.common.artifact.repository.remote.RemoteRepository | ||
import com.tencent.bkrepo.common.artifact.repository.virtual.VirtualRepository | ||
import com.tencent.bkrepo.common.security.http.core.HttpAuthSecurityCustomizer | ||
import org.springframework.context.annotation.Configuration | ||
|
||
@Configuration | ||
class WebSocketConfigurer : ArtifactConfigurerSupport() { | ||
|
||
override fun getRepositoryType() = RepositoryType.NONE | ||
override fun getLocalRepository(): LocalRepository = object : LocalRepository() {} | ||
override fun getRemoteRepository(): RemoteRepository = object : RemoteRepository() {} | ||
override fun getVirtualRepository(): VirtualRepository = object : VirtualRepository() {} | ||
|
||
override fun getAuthSecurityCustomizer() = | ||
HttpAuthSecurityCustomizer { httpAuthSecurity -> httpAuthSecurity.withPrefix("/websocket") } | ||
} |
37 changes: 37 additions & 0 deletions
37
.../biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/config/WebSocketProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.websocket.config | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
|
||
@ConfigurationProperties("websocket") | ||
data class WebSocketProperties( | ||
var cacheLimit: Int = 3600, | ||
var minThread: Int = 8, | ||
var transfer: Boolean = false | ||
) |
116 changes: 116 additions & 0 deletions
116
...z-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/config/WebsocketConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.websocket.config | ||
|
||
import com.tencent.bkrepo.common.security.http.jwt.JwtAuthProperties | ||
import com.tencent.bkrepo.common.security.manager.AuthenticationManager | ||
import com.tencent.bkrepo.websocket.constant.APP_ENDPOINT | ||
import com.tencent.bkrepo.websocket.constant.USER_ENDPOINT | ||
import com.tencent.bkrepo.websocket.dispatch.push.TransferPush | ||
import com.tencent.bkrepo.websocket.handler.SessionWebSocketHandlerDecoratorFactory | ||
import com.tencent.bkrepo.websocket.listener.TransferPushListener | ||
import com.tencent.bkrepo.websocket.service.WebsocketService | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.messaging.Message | ||
import org.springframework.messaging.simp.config.ChannelRegistration | ||
import org.springframework.messaging.simp.config.MessageBrokerRegistry | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler | ||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker | ||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry | ||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer | ||
import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration | ||
import java.util.function.Consumer | ||
|
||
@Configuration | ||
@EnableWebSocketMessageBroker | ||
@EnableConfigurationProperties(WebSocketProperties::class) | ||
class WebsocketConfiguration( | ||
private val webSocketProperties: WebSocketProperties, | ||
private val websocketService: WebsocketService, | ||
private val jwtAuthProperties: JwtAuthProperties, | ||
private val authenticationManager: AuthenticationManager, | ||
private val taskScheduler: ThreadPoolTaskScheduler | ||
) : WebSocketMessageBrokerConfigurer { | ||
|
||
override fun configureMessageBroker(config: MessageBrokerRegistry) { | ||
config.setCacheLimit(webSocketProperties.cacheLimit) | ||
config.enableSimpleBroker("/topic") | ||
.setHeartbeatValue(longArrayOf(3000,3000)) | ||
.setTaskScheduler(taskScheduler) | ||
config.setApplicationDestinationPrefixes("/app") | ||
} | ||
|
||
override fun registerStompEndpoints(registry: StompEndpointRegistry) { | ||
registry.addEndpoint(USER_ENDPOINT, APP_ENDPOINT) | ||
.setAllowedOriginPatterns("*") | ||
registry.addEndpoint(USER_ENDPOINT, APP_ENDPOINT) | ||
.setAllowedOriginPatterns("*") | ||
.withSockJS() | ||
} | ||
|
||
@Override | ||
override fun configureClientInboundChannel(registration: ChannelRegistration) { | ||
var defaultCorePoolSize = webSocketProperties.minThread | ||
if (defaultCorePoolSize < Runtime.getRuntime().availableProcessors() * 2) { | ||
defaultCorePoolSize = Runtime.getRuntime().availableProcessors() * 2 | ||
} | ||
registration.taskExecutor().corePoolSize(defaultCorePoolSize) | ||
.maxPoolSize(defaultCorePoolSize * 2) | ||
.keepAliveSeconds(60) | ||
} | ||
|
||
@Override | ||
override fun configureClientOutboundChannel(registration: ChannelRegistration) { | ||
var defaultCorePoolSize = webSocketProperties.minThread | ||
if (defaultCorePoolSize < Runtime.getRuntime().availableProcessors() * 2) { | ||
defaultCorePoolSize = Runtime.getRuntime().availableProcessors() * 2 | ||
} | ||
registration.taskExecutor().corePoolSize(defaultCorePoolSize).maxPoolSize(defaultCorePoolSize * 2) | ||
} | ||
|
||
override fun configureWebSocketTransport(registration: WebSocketTransportRegistration) { | ||
registration.addDecoratorFactory(wsHandlerDecoratorFactory()) | ||
super.configureWebSocketTransport(registration) | ||
} | ||
|
||
@Bean | ||
fun wsHandlerDecoratorFactory(): SessionWebSocketHandlerDecoratorFactory { | ||
return SessionWebSocketHandlerDecoratorFactory( | ||
websocketService = websocketService, | ||
authenticationManager = authenticationManager, | ||
jwtAuthProperties = jwtAuthProperties | ||
) | ||
} | ||
|
||
@Bean | ||
fun websocketTransferConsumer(transferPushListener: TransferPushListener): Consumer<Message<TransferPush>> { | ||
return Consumer { transferPushListener.accept(it) } | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...main/kotlin/com/tencent/bkrepo/websocket/config/WsThreadPoolTaskExeccutorConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.websocket.config | ||
|
||
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration | ||
import org.springframework.boot.task.TaskExecutorBuilder | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.context.annotation.Lazy | ||
import org.springframework.context.annotation.Primary | ||
import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor | ||
|
||
/** | ||
* Websocket会注册自定义的ThreadPoolTaskExecutor | ||
* | ||
* [org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration.clientInboundChannelExecutor] | ||
* | ||
* [org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration.clientOutboundChannelExecutor] | ||
* | ||
* [org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration.brokerChannelExecutor] | ||
* | ||
* 导致默认的ThreadPoolTaskExecutor不会实例化 | ||
* | ||
* [org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration.applicationTaskExecutor] | ||
* | ||
*/ | ||
@Configuration | ||
class WsThreadPoolTaskExeccutorConfiguration { | ||
|
||
@Lazy | ||
@Bean(name = [ | ||
TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME, | ||
AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME | ||
]) | ||
@Primary | ||
fun applicationTaskExecutor(builder: TaskExecutorBuilder): ThreadPoolTaskExecutor { | ||
return builder.build() | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...cket/biz-websocket/src/main/kotlin/com/tencent/bkrepo/websocket/constant/WebsocketKeys.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. | ||
* | ||
* A copy of the MIT License is included in this file. | ||
* | ||
* | ||
* Terms of the MIT License: | ||
* --------------------------------------------------- | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
* the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.tencent.bkrepo.websocket.constant | ||
|
||
const val USER_ENDPOINT = "/ws/user" | ||
const val APP_ENDPOINT = "/ws/app" | ||
|
||
const val SESSION_ID = "sessionId" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么要
setAllowedOriginPatterns
两次There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是两个不同的endpoint,需要单独设置