AntaresGuo commited on
Commit
fe888d3
1 Parent(s): 867e2e4

Update interface_modules/X2Painting/client_process.py

Browse files
interface_modules/X2Painting/client_process.py CHANGED
@@ -20,9 +20,13 @@ def send_to_server(word, style_name):
20
  }
21
  }
22
 
 
 
23
  # prepare to send
24
  post_addr = server_config.post_addr
25
  json_data = json.dumps(send_data)
 
 
26
  response = requests.post(post_addr, data=json_data, headers=server_config.headers)
27
 
28
  # process feed back images
 
20
  }
21
  }
22
 
23
+ # authentication
24
+ token = requests.post(server_config.login_url, data=server_config.login_data).json()["access_token"]
25
  # prepare to send
26
  post_addr = server_config.post_addr
27
  json_data = json.dumps(send_data)
28
+ headers = server_config.headers
29
+ headers["Authorization"] = f"Bearer {token}"
30
  response = requests.post(post_addr, data=json_data, headers=server_config.headers)
31
 
32
  # process feed back images