带有 Nova 的 Vapor 签名存储 URL 401

问题描述

我正在尝试在 Vapor 服务器上的 Laravel Nova 中上传文件。 当我尝试上传时,它不断向我显示 /vapor/signed-storage-url 上的 401 响应。

我错过了什么?

这是我的 Nova 资源:

public function fields(Request $request)
{
   return [
    VaporFile::make('Attachment')->rules('bail','required',function ($attribute,$value,$fail) use ($request) {
        if (Storage::size($request->input('vaporFile')[$attribute]['key']) > 1000000) {
            return $fail('The document size may not be greater than 1 MB');
        }
    }),

这是添加到我的 app.js:

window.Vapor = require("laravel-vapor");

这是我注册的政策:

class UserPolicy
{
    use HandlesAuthorization;

    /**
     * Determine whether the user can upload files.
     *
     * @param  \App\User  $user
     * @return mixed
     */
    public function uploadFiles(User $user)
    {
        return true; 
    }

在我看来,我做的一切都正确......但它仍然失败。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)