@@ -2,7 +2,7 @@ let taskId = 0
22let taskStatus = 0
33let elapseSeconds = 0
44
5- const webapi = 'http://192.168.121.108:8000 /api/r1/tasks/try_pyarmor/'
5+ const webapi = '/api/r1/tasks/try_pyarmor/'
66
77const resultModal = document . getElementById ( 'resultModal' )
88const confirmModal = document . getElementById ( 'confirmModal' )
@@ -71,14 +71,15 @@ const send_request = (method, url, data, onsuccess, onerror) => {
7171
7272 // 只是为了开发测试使用, admin 用户和密码
7373 // 'WWW-Authenticate': 'Basic YWRtaW46YWRtaW4='
74- headers . append ( 'Authorization' , 'Basic YWRtaW46YWRtaW4=' )
74+ // headers.append('Authorization', 'Basic YWRtaW46YWRtaW4=')
7575
7676 // flyuser 用户的密码 "(thxjv!t8-F9*9j!q=)"
77- // const username = `flyuser-pyarmor`
78- // const basicauth = btoa(`${username}:(thxjv!t8-F9*9j!q=)`)
79- // headers.append('Authorization', `Basic ${basicauth}`)
80- // headers.append("Content-Type", "application/octet-stream")
77+ const username = `flyuser-pyarmor`
78+ const basicauth = btoa ( `${ username } :(thxjv!t8-F9*9j!q=)` )
79+ headers . append ( 'Authorization' , `Basic ${ basicauth } ` )
80+
8181
82+ // headers.append("Content-Type", "application/octet-stream")
8283 if ( method === 'POST' || method === 'PUT' )
8384 headers . append ( "Content-Type" , "application/json" )
8485
@@ -112,7 +113,7 @@ const send_request = (method, url, data, onsuccess, onerror) => {
112113const enable_download_link = ( data ) => {
113114 const scriptName = document . getElementById ( 'scriptName' ) . value
114115 const blob = new Blob ( [ data ] )
115- const a = resultModal . querySelector ( '.modal-body > div.alert:nth-child(3) > a' )
116+ const a = resultModal . querySelector ( '.modal-body > div.alert:nth-child(3) > p > a' )
116117 a . href = URL . createObjectURL ( blob )
117118 a . download = scriptName
118119 resultModal . querySelector ( '.modal-body > div.alert:nth-child(1)' ) . classList . add ( 'd-none' )
0 commit comments