小编Fan*_*mic的帖子

PHP openssl_pkcs12_read“错误:0308010C:数字信封例程::不支持”

Error message "error:0308010C:digital envelope routines::unsupported"我在尝试打开文件时收到错误.pfx

$result = openssl_pkcs12_read($content, $certdata, $pass);
$error = openssl_error_string(); // "error:0308010C:digital envelope routines::unsupported"
Run Code Online (Sandbox Code Playgroud)

在终端(Ubuntu 22.04)中:

user@user-tp:~$ php -i | grep -i openssl
SSL Version => OpenSSL/3.0.2
libSSH Version => libssh/0.9.6/openssl/zlib
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 3.0.2 15 Mar 2022
OpenSSL Header Version => OpenSSL 3.0.2 15 Mar 2022
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native …
Run Code Online (Sandbox Code Playgroud)

php ubuntu openssl laravel

10
推荐指数
1
解决办法
9595
查看次数

如何在 Vue3 Composition API 上使用 Vue2 插件?

我正在迁移我的 Vue2 应用程序来使用@vue/composition-api(Vue 版本仍然是 2 而不是 3)。

在 Vue2 中我使用我的插件,this.$sessionthis在 Vue3 上不起作用。我找到的解决方案是这样使用:

setup (props, context) {
  context.root.$session // works fine
  context.root.$anotherPlugin 
}
Run Code Online (Sandbox Code Playgroud)

然而在 Vue3 中context.root@deprecated这样,当我迁移到 Vue3 时它就不再工作了。

还有其他方法可以访问里面的Vue实例吗setup()?我想如果我可以访问它,我就可以在 Vue3 上正常使用这些插件。

javascript vue.js vuejs3 vue-composition-api

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

Vue - 解构对象(数据)

如何对 Vue 组件数据使用对象解构?这是我的实际代码:

data: () => ({
  descricao: '',
  perfilBase: null,
  anotherField: '',
  otherOne: false
}),

mounted () {
  this.descricao = this.$route.query.descricao
  this.perfilBase = this.$route.query.perfilBase
}
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这样呢?是否可以?

mounted () {
  { this.descricao, this.perfilBase } = ...this.$route.query
}
Run Code Online (Sandbox Code Playgroud)

javascript destructuring ecmascript-6 vue.js

3
推荐指数
1
解决办法
6509
查看次数

Laravel - 自动加载 Auth::user() 关系

我想知道是否有可能以某种方式自动加载所有Auth::user()关系。

Auth::user()返回 my 的一个实例App\Models\Auth\Usuario.php,并且在Usuario.php类内部我与其他模型有一些关系。

我现在这样做的方式是手动加载关系,$user->load('relation')但我需要在每个请求中都这样做。

我想在我的基本控制器中做这样的事情:

public function __construct()
{
    $user = Auth::user();
    $this->relation = $user->load('relation');
}
Run Code Online (Sandbox Code Playgroud)

但这不正是我要找的。

还有另一种/最好的方法来加载所有的Auth::user()类关系吗?比如中间件之类的?

php laravel eloquent

2
推荐指数
1
解决办法
583
查看次数