File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ async function fetchTask(c) {
106
106
const printersInfo : any [ ] = await getPrinters ( ) ;
107
107
const tasks = [ ] ;
108
108
for ( let i = 0 ; i < config . printMergeQueue ; i ++ ) {
109
- const { body } = await post ( `${ c . server } / client/${ c . token } /print` )
109
+ const { body } = await post ( `${ c . server } client/${ c . token } /print` )
110
110
. send ( {
111
111
printers : config . printers ,
112
112
printersInfo : JSON . stringify ( printersInfo . map ( ( p ) => ( {
@@ -123,7 +123,7 @@ async function fetchTask(c) {
123
123
if ( body . doc ) {
124
124
tasks . push ( body . doc ) ;
125
125
// FIXME: so ugly, give server merge task number
126
- if ( config . printMergeQueue !== 1 ) await post ( `${ c . server } / client/${ c . token } /doneprint/${ body . doc . _id } ` ) ;
126
+ if ( config . printMergeQueue !== 1 ) await post ( `${ c . server } client/${ c . token } /doneprint/${ body . doc . _id } ` ) ;
127
127
}
128
128
}
129
129
if ( tasks . length ) {
@@ -137,7 +137,7 @@ async function fetchTask(c) {
137
137
throw e ;
138
138
}
139
139
for ( const doc of tasks ) {
140
- await post ( `${ c . server } / client/${ c . token } /doneprint/${ doc . _id } ?printer=${ JSON . stringify ( printer ) } ` ) ;
140
+ await post ( `${ c . server } client/${ c . token } /doneprint/${ doc . _id } ?printer=${ JSON . stringify ( printer ) } ` ) ;
141
141
logger . info ( `Print task ${ doc . tid } #${ doc . _id } completed.` ) ;
142
142
}
143
143
} else {
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ const serverSchema = Schema.intersect([
86
86
] ) ,
87
87
] ) ;
88
88
const clientSchema = Schema . object ( {
89
- server : Schema . string ( ) . role ( 'url' ) . required ( ) ,
89
+ server : Schema . transform ( String , ( i ) => ( i . endsWith ( '/' ) ? i : ` ${ i } /` ) ) . role ( 'url' ) . required ( ) ,
90
90
balloon : Schema . string ( ) ,
91
91
balloonLang : Schema . union ( [ 'zh' , 'en' ] ) . default ( 'zh' ) . required ( ) ,
92
92
balloonType : Schema . union ( [ 58 , 80 , 'plain' ] ) . default ( 80 ) ,
You can’t perform that action at this time.
0 commit comments