小编ASH*_*lah的帖子

错误:03000086:数字信封例程::Vue.Js 项目上的初始化错误

当我在终端中运行“npm runserve/build”语法时,我的 Vue 项目出现错误。

我的 npm 节点版本是 v18.12.0 (带有 npm 8.19.2)

错误信息是:

  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
Run Code Online (Sandbox Code Playgroud)

我尝试搜索解决方案,但很多解决方案都是针对 React 的,但它不起作用。

node.js vue.js

7
推荐指数
1
解决办法
1万
查看次数

如何在 Laravel Inertia 上全局添加 _token csrf?

我有一个使用 Laravel Inertia 和 Vue Js 的项目。这些天我遇到了 csrf 令牌的问题。我已经阅读了这里的文档https://inertiajs.com/csrf-protection,所以也许我应该在每个惯性请求/响应上添加 csrf 令牌。

我的问题是,如何全局添加这个_token?所以我不需要一一添加令牌到我的vue文件中,因为它的文件太多了。

我当前在login.vue上的脚本代码:

props: {
        errors: Object,
        session: Object,
        auth: Array
    },

    //define composition API
    setup(props) {
        //define form state
        const form = reactive({
            email: '',
            password: '',
        });

        //submit method
        const submit = () => {

            //send data to server
            Inertia.post('/login', {

                //data
                email: form.email,
                password: form.password,
                _token: props.auth.csrf
            });
        }
Run Code Online (Sandbox Code Playgroud)

我的 HandleInertiaRequest (中间件):

<?php

namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Inertia\Middleware;

class HandleInertiaRequests extends Middleware
{
    /** …
Run Code Online (Sandbox Code Playgroud)

php inertiajs laravel

5
推荐指数
1
解决办法
3043
查看次数

在 React Native 和 NodeJS 后端中使用 Google 登录

如何在前端的 React Native 和后端的 NodeJS MonggoDB 中使用 Google 登录?

node.js reactjs react-native

4
推荐指数
1
解决办法
3525
查看次数

'props' 被分配了一个值但从未使用过 no-unused-vars vue3

我在我的 vue 组件文件上使用。我的组件代码:

<template>
    <router-link :to="{ name: routerName }" type="is-primary"
        class="inline-flex justify-center py-2 px-3 mb-3 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
        <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
        </svg>&nbsp;Cancel
    </router-link>
</template>

<script setup>
const props = defineProps({
    routerName: {
        type: String,
        required: true
    }
})
</script>
Run Code Online (Sandbox Code Playgroud)

但它返回 eslint 错误'props' …

javascript vue.js

4
推荐指数
1
解决办法
3746
查看次数

标签 统计

node.js ×2

vue.js ×2

inertiajs ×1

javascript ×1

laravel ×1

php ×1

react-native ×1

reactjs ×1