DmitrMakeev commited on
Commit
9ba3e78
·
verified ·
1 Parent(s): 35d6525

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -2249,8 +2249,7 @@ def upload_page_vk():
2249
 
2250
 
2251
 
2252
- # Дублированный маршрут для обслуживания загруженных страниц
2253
- @app.route('/page_vk/<path:filename>', methods=['GET'])
2254
  def serve_html_vk(filename):
2255
  try:
2256
  # Получаем параметры из GET-запроса
@@ -2260,25 +2259,21 @@ def serve_html_vk(filename):
2260
  vk_are_notifications_enabled = request.args.get('vk_are_notifications_enabled')
2261
  vk_is_app_user = request.args.get('vk_is_app_user')
2262
 
2263
-
2264
  # Параметры запроса
2265
  params = {
2266
- 'vk_app_id': vk_app_id,
2267
- 'vk_are_notifications_enabled': vk_are_notifications_enabled,
2268
- 'vk_is_app_user': vk_is_app_user'
2269
  }
2270
 
2271
  # Формирование URL с использованием f-строк
2272
  fullUrl = f"{base_url}?{'&'.join([f'{key}={value}' for key, value in params.items()])}"
2273
 
2274
-
2275
-
2276
-
2277
-
2278
  logging.debug(f"Received params: apps_id={apps_id}")
2279
  logging.debug(f"Received params: fullUrl={fullUrl}")
2280
  logging.debug(f"Received params: vk_app_id={vk_app_id}")
2281
  logging.debug(f"Received params: vk_are_notifications_enabled={vk_are_notifications_enabled}")
 
2282
  # Преобразуем строку в JSON
2283
  try:
2284
  api_key_apps_vk_dict = json.loads(api_key_apps_vk)
@@ -2308,12 +2303,22 @@ def serve_html_vk(filename):
2308
  # Если верификация прошла успешно, отдаём файл
2309
  if not filename.endswith('.html'):
2310
  filename += '.html'
 
2311
  return send_from_directory(HTML_FOLDER_VK, filename)
2312
 
2313
  except Exception as e:
2314
  logging.error(f"An error occurred: {str(e)}")
2315
  return jsonify({"error": str(e)}), 500
2316
 
 
 
 
 
 
 
 
 
 
2317
 
2318
  # Дублированный маршрут для отображения страницы загрузки
2319
  @app.route('/up_page_vk', methods=['GET'])
 
2249
 
2250
 
2251
 
2252
+ app.route('/page_vk/<path:filename>', methods=['GET'])
 
2253
  def serve_html_vk(filename):
2254
  try:
2255
  # Получаем параметры из GET-запроса
 
2259
  vk_are_notifications_enabled = request.args.get('vk_are_notifications_enabled')
2260
  vk_is_app_user = request.args.get('vk_is_app_user')
2261
 
 
2262
  # Параметры запроса
2263
  params = {
2264
+ 'vk_app_id': vk_app_id,
2265
+ 'vk_are_notifications_enabled': vk_are_notifications_enabled,
2266
+ 'vk_is_app_user': vk_is_app_user
2267
  }
2268
 
2269
  # Формирование URL с использованием f-строк
2270
  fullUrl = f"{base_url}?{'&'.join([f'{key}={value}' for key, value in params.items()])}"
2271
 
 
 
 
 
2272
  logging.debug(f"Received params: apps_id={apps_id}")
2273
  logging.debug(f"Received params: fullUrl={fullUrl}")
2274
  logging.debug(f"Received params: vk_app_id={vk_app_id}")
2275
  logging.debug(f"Received params: vk_are_notifications_enabled={vk_are_notifications_enabled}")
2276
+
2277
  # Преобразуем строку в JSON
2278
  try:
2279
  api_key_apps_vk_dict = json.loads(api_key_apps_vk)
 
2303
  # Если верификация прошла успешно, отдаём файл
2304
  if not filename.endswith('.html'):
2305
  filename += '.html'
2306
+
2307
  return send_from_directory(HTML_FOLDER_VK, filename)
2308
 
2309
  except Exception as e:
2310
  logging.error(f"An error occurred: {str(e)}")
2311
  return jsonify({"error": str(e)}), 500
2312
 
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+
2322
 
2323
  # Дублированный маршрут для отображения страницы загрузки
2324
  @app.route('/up_page_vk', methods=['GET'])