浏览代码

update actions

update
jqh 5 年之前
父节点
当前提交
06af2772d8
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      src/Actions/Response.php

+ 11 - 1
src/Actions/Response.php

@@ -116,7 +116,7 @@ class Response
      */
     public function download($url)
     {
-        return $this->then(['action' => 'download', 'value' => $url]);
+        return $this->then(['action' => 'download', 'value' => admin_url($url)]);
     }
 
     /**
@@ -129,6 +129,16 @@ class Response
         return $this->then(['action' => 'refresh', 'value' => true]);
     }
 
+    /**
+     * @param string $script
+     *
+     * @return $this
+     */
+    public function script($script)
+    {
+        return $this->then(['action' => 'script', 'value' => $script]);
+    }
+
     /**
      * @param array $value
      *