@@ -2,7 +2,7 @@ let taskId = 0
2
2
let taskStatus = 0
3
3
let elapseSeconds = 0
4
4
5
- const webapi = 'http://192.168.121.108:8000 /api/r1/tasks/try_pyarmor/'
5
+ const webapi = '/api/r1/tasks/try_pyarmor/'
6
6
7
7
const resultModal = document . getElementById ( 'resultModal' )
8
8
const confirmModal = document . getElementById ( 'confirmModal' )
@@ -71,14 +71,15 @@ const send_request = (method, url, data, onsuccess, onerror) => {
71
71
72
72
// 只是为了开发测试使用, admin 用户和密码
73
73
// 'WWW-Authenticate': 'Basic YWRtaW46YWRtaW4='
74
- headers . append ( 'Authorization' , 'Basic YWRtaW46YWRtaW4=' )
74
+ // headers.append('Authorization', 'Basic YWRtaW46YWRtaW4=')
75
75
76
76
// 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
+
81
81
82
+ // headers.append("Content-Type", "application/octet-stream")
82
83
if ( method === 'POST' || method === 'PUT' )
83
84
headers . append ( "Content-Type" , "application/json" )
84
85
@@ -112,7 +113,7 @@ const send_request = (method, url, data, onsuccess, onerror) => {
112
113
const enable_download_link = ( data ) => {
113
114
const scriptName = document . getElementById ( 'scriptName' ) . value
114
115
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' )
116
117
a . href = URL . createObjectURL ( blob )
117
118
a . download = scriptName
118
119
resultModal . querySelector ( '.modal-body > div.alert:nth-child(1)' ) . classList . add ( 'd-none' )
0 commit comments