@@ -40,7 +40,10 @@ const validateTraffic = (num) => {
4040 return true
4141}
4242
43- const getDefaultProtocol = ( protocols ) => {
43+ const getDefaultProtocol = ( protocols , inputs ) => {
44+ if ( inputs && inputs . protocolType === 'WS' && inputs . type === 'web' ) {
45+ return 'ws'
46+ }
4447 return String ( protocols ) . includes ( 'https' ) ? 'https' : 'http'
4548}
4649
@@ -188,7 +191,7 @@ const formatInputs = async (instance, credentials, appId, inputs) => {
188191 inputs . publish = false
189192 }
190193 // 如果是ws函数,protocolType置为WEBSOCKET
191- if ( inputs . protocolType === 'WS' || inputs . type === 'web' ) {
194+ if ( inputs . protocolType === 'WS' && inputs . type === 'web' ) {
192195 inputs . events &&
193196 inputs . events . forEach ( ( v ) => {
194197 v . apigw . parameters . endpoints &&
@@ -197,7 +200,7 @@ const formatInputs = async (instance, credentials, appId, inputs) => {
197200 } )
198201 } )
199202 }
200-
203+
201204 // 基于镜像部署
202205 let imageCode
203206 if ( inputs . image ) {
@@ -272,8 +275,8 @@ const formatInputs = async (instance, credentials, appId, inputs) => {
272275 getDefaultServiceName ( instance )
273276
274277 let { serviceId } = currentEvent . parameters
275- currentEvent . parameters . isInputServiceId = ! ! serviceId
276- currentEvent . parameters . serviceName = serviceName
278+ // currentEvent.parameters.isInputServiceId = !!serviceId
279+ // currentEvent.parameters.serviceName = serviceName
277280 currentEvent . parameters . description =
278281 currentEvent . parameters . description || getDefaultServiceDescription ( instance )
279282 currentEvent . name = currentEvent . name || getDefaultTriggerName ( eventType , instance )
0 commit comments