File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -267,14 +267,19 @@ export function sourcesValidate(sources: Array<SourceConfig>): Array<string> {
267267 errmsgs . push ( `sources's NO.${ index } item verify fail,Pleas fill in sources's type with ${ SOURCE_TYPES . join ( "|" ) } ` ) ;
268268 }
269269
270- const content = i . content ;
271- const indexOf = content . indexOf ( "//" ) ;
272- if ( indexOf + 1 == content . length - 1 ) {
270+ let content = i . content ;
271+ if ( _ . isEmpty ( content ) ) {
273272 errmsgs . push ( `sources's NO.${ index } item verify fail,sources's content is required!` ) ;
274-
275273 }
276- i . content = content . substring ( indexOf + 2 ) ;
277-
274+ const indexOf = content . indexOf ( "//" ) ;
275+ // 去掉协议
276+ if ( indexOf != - 1 ) {
277+ console . log ( 111 )
278+ i . content = content = content . substring ( indexOf + 2 ) ;
279+ if ( _ . isEmpty ( content ) ) {
280+ errmsgs . push ( `sources's NO.${ index } item verify fail,sources's content is required!` ) ;
281+ }
282+ }
278283 const sourcePort = i . port ;
279284 if ( sourcePort && ! ( typeof sourcePort == 'number' ) ) {
280285 errmsgs . push ( `sources's NO.${ index } item verify fail,sources's port expected is number!` ) ;
You can’t perform that action at this time.
0 commit comments