m-cloud API Documentation - v1.0.1-beta.5
    Preparing search index...

    Function parseAction

    • 解析 action 字段 支持从 action 或 path 提取路由信息

      Parameters

      • event: UniCloudEvent

        UniCloud 事件对象

      Returns string

      解析后的 action 字符串

      // 纯路径
      parseAction({ path: '/user/getList' })
      // event.action = 'user/getList'

      // 带HTTP方法的路径
      parseAction({ action: 'GET user/getList' })
      // event.action = 'user/getList', event.httpMethod = 'GET'