全部產品
Search
文件中心

Mobile Platform as a Service:限流配置

更新時間:Jul 13, 2024

限流配置包括限流模式、限流值、限流響應:

  • 限流模式

    • 關閉:不限制 API 呼叫。

    • 攔截:當調用頻次超過限流值,攔截請求。

  • 限流值 根據業務需求設定合理的限流閾值(單位:秒)。限流模式為攔截且超過此值時,請求會被限流。

  • 限流響應 限流預設的響應為:{"resultStatus":1002,"tips":"顧客太多,客官請稍候"} 如需定製限流響應,使用如下格式:

      {
          "result": "==此處為定製響應內容,請填寫==",
          "tips": "ok",
          "resultStatus": 1000
      }

    其中:

    • result 為定製的響應資料,JSON 格式。只有 resultStatus 為 1000 時,用戶端才會取此欄位處理。

    • tips 為定製的限流提示。若 resultStatus 為 1002,會取此欄位提示使用者。

    • resultStatus 為限流返回的結果碼,具體含義請參見 網關結果碼說明