doUPresys.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. include_once("../../untils/conn.php");
  3. $tx_appid = $_POST['tx_appid'];
  4. $tx_appkey = $_POST['tx_appkey'];
  5. $al_appid = $_POST['al_appid'];
  6. $al_key = $_POST['al_key'];
  7. $auto = $_POST['auto'];
  8. // echo "tx_appid: " . $tx_appid . "<br>";
  9. // echo "tx_appkey: " . $tx_appkey . "<br>";
  10. // echo "al_appid: " . $al_appid . "<br>";
  11. // echo "al_key: " . $al_key . "<br>";
  12. // echo "auto: " . $auto . "<br>";
  13. echo "<script>alert('暂不支持该修改操作!!!'); window.history.back();</script>";
  14. exit;
  15. // 更新腾讯相关字段
  16. if (!empty($tx_appid) || !empty($tx_appkey)) {
  17. $query = "UPDATE system SET appid='$tx_appid', appkey='$tx_appkey' WHERE type='tencent'";
  18. $result = mysqli_query($con, $query);
  19. if (!$result) {
  20. // 更新失败
  21. echo "<script>alert('更新腾讯云信息失败'); window.history.back();</script>";
  22. exit;
  23. }
  24. }
  25. // 更新阿里云相关字段
  26. if (!empty($al_appid) || !empty($al_key)) {
  27. $query = "UPDATE system SET appid='$al_appid', appkey='$al_key' WHERE type='aliyun'";
  28. $result = mysqli_query($con, $query);
  29. if (!$result) {
  30. // 更新失败
  31. echo "<script>alert('更新阿里云信息失败'); window.history.back();</script>";
  32. exit;
  33. }
  34. }
  35. // 更新系统字段
  36. if (!empty($auto)) {
  37. $query = "UPDATE system SET auto='$auto' WHERE type='xitong'";
  38. $result = mysqli_query($con, $query);
  39. if (!$result) {
  40. // 更新失败
  41. echo "<script>alert('更新系统信息失败'); window.history.back();</script>";
  42. exit;
  43. }
  44. }
  45. // 更新成功
  46. echo "<script>alert('操作成功'); window.history.back();</script>";
  47. exit;
  48. ?>