小编Ru *_*ong的帖子

Axios 打字稿自定义 AxiosRequestConfig

我正在使用 React 和 axios,最近我在 axios 上创建了一个自定义配置,如下所示:

import $axios from 'helpers/axiosInstance'
$axios.get('/customers', { handlerEnabled: false })
Run Code Online (Sandbox Code Playgroud)

但结果 ts 编译:

'{ handlerEnabled: boolean; 类型的参数 }' 不可分配给类型为 'AxiosRequestConfig' 的参数。对象字面量只能指定已知属性,并且类型“AxiosRequestConfig”中不存在“handlerEnabled”。

如何在 AxiosRequestConfig 上分配新类型?像这样的东西axios<AxiosRequestConfig & newType>

不想使用旧方法 .d.ts

javascript types typescript reactjs axios

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

更新Vuetify版本

为了更新我的项目vuetify,我更改了package.json中的版本并执行了'npm install'.vuetify已从node_modules文件夹中删除!我该如何重新安装?为什么'npm install vuetify'没有把它带回node_modules?

npm vue.js vuejs2 vuetify.js

9
推荐指数
3
解决办法
2万
查看次数

从放置事件获取文件路径

我有一些 javascript 代码,允许用户在 IE 中拖放文件。

我遇到的问题是他们希望文件被拖动后删除,但我似乎无法获取文件路径,只能获取名称。

我见过很多对 的引用,但当我尝试时e.dataTransfer.files[0].path它总是会回来。'undefined'

任何想法为什么e.dataTransfer.files[0].path不起作用,或者我如何获取文件路径?

 $(document).ready(function (ex) {
        var holder = document.getElementById('holder');
        holder.ondragover = function () { this.className = 'hover'; return false; };
        holder.ondrop = function (e) {
            e.preventDefault();
            var file = e.dataTransfer.files[0];
            var path = e.dataTransfer.files[0].path;
            fileArray.push(file);
            //alert(e.target.id);
            var reader = new FileReader();
            reader.readAsDataURL(file);
        };
    });
Run Code Online (Sandbox Code Playgroud)

javascript

8
推荐指数
2
解决办法
9538
查看次数

在vue cli 3生成的项目中启动dev服务器

我在我的Windows系统上使用全局安装了vue cli 3 npm i -g @vue/cli.

然后我使用生成了一个项目 vue create vue-project

我通过提示选择了所需的插件.

这创造了一个vue-projject foler.然后我将目录更改为该文件夹并运行npm run serve命令.

但我得到以下错误

PS E:\rk\workspace\vue-project> npm run serve

> vue-project@0.1.0 serve E:\rk\workspace\vue-project
> vue-cli-service serve

INFO  Starting development server...
94% asset optimization

ERROR  Failed to compile with 1 errors                                                                 14:58:40

error  in ./src/main.js

Module build failed: Error: [BABEL] E:\rk\workspace\vue-project\src\main.js: The new decorators proposal is not supported yet. You must pass the `"decoratorsLegacy": true` option to @babel/preset-stage-2 (While processing: "E:\\rk\\workspace\\vue-project\\node_modules\\@vue\\babel-preset-app\\index.js$1")
    at E:\rk\workspace\vue-project\node_modules\@babel\preset-stage-2\lib\index.js:107:11
    at E:\rk\workspace\vue-project\node_modules\@babel\helper-plugin-utils\lib\index.js:18:12 …
Run Code Online (Sandbox Code Playgroud)

webpack vue.js babeljs vuejs2 vue-cli

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

该请求无权使用该权限执行该操作

我正在尝试使用以下配置在 dattabricks 中安装 adls gen2

configs = {"fs.azure.account.auth.type": "OAuth",
   "fs.azure.account.oauth.provider.type": "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",
   "fs.azure.account.oauth2.client.id": "service principal id",
   "fs.azure.account.oauth2.client.secret": "service principal key",
   "fs.azure.account.oauth2.client.endpoint": "https://login.microsoftonline.com/tenant-id/oauth2/token",
   "fs.azure.createRemoteFileSystemDuringInitialization": "true"}
dbutils.fs.mount(
source = "abfss://file-system@storage-account.dfs.core.windows.net/directory",
mount_point = "/mnt/data",
extra_configs = configs)
Run Code Online (Sandbox Code Playgroud)

我已创建服务主体并为其创建密钥,然后在 Active Directory 角色分配中向该服务主体提供存储 Blob 角色

根据文件

"abfss://<your-file-system-name>@<your-storage-account-name>.dfs.core.windows.net/<your-directory-name>"
Run Code Online (Sandbox Code Playgroud)

blob 容器内的 your-file-system ==> 文件夹应该是什么?you-directory-name ==> 我在 Blob 容器内只有一个文件夹,所以这里很混乱 storgae(ADLS gen 2 Preview) Blob 容器文件夹 a.txt

错误


ExecutionError:调用 o480.mount 时发生错误。HEAD https://xxxxxxxxx.dfs.core.windows.net/xxxxxx?resource=filesystem&timeout=90 StatusCode=403 StatusDescription=此请求无权使用此权限执行此操作。ErrorCode=ErrorMessage=在shaded.databricks.v20180920_b33d810.org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation.execute(AbfsRestOperation.java:134)在shaded.databricks.v20180920_b33d810.org.apache.hadoop.fs.azurebfs。 services.AbfsClient.getFilesystemProperties(AbfsClient.java:197)位于shaded.databricks.v20180920_b33d810.org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.getFilesystemProperties(AzureBlobFileSystemStore.java:214)位于shaded.databricks.v20180920_b33d810。 org.apache. hadoop.fs.azurebfs.AzureBlobFileSystem.fileSystemExists(AzureBlobFileSystem.java:749)位于shaded.databricks.v20180920_b33d810.org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.initialize(AzureBlobFileSystem.java:110)位于com.databricks.backend。 daemon.dbutils.DBUtilsCore.verifyAzureFileSystem(DBUtilsCore.scala:485) 在 com.databricks.backend.daemon.dbutils.DBUtilsCore.mount(DBUtilsCore.scala:435) 在 sun.reflect.GenerateMethodAccessor400.invoke(未知来源) 在太阳。 Reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) 在 py4j.reflection.ReflectionEngine …

databricks azure-databricks

6
推荐指数
2
解决办法
6万
查看次数

react-native android 错误无法安装应用程序 native_modules.gradle' line: 170

在 Windows 中运行 react-native run-android 但出现此错误:

错误 无法安装应用程序。确保您已设置 Android 开发环境:https : //facebook.github.io/react-native/docs/getting-started.html#android-development-environment。使用 --verbose 标志运行 CLI 以获取更多详细信息。错误:命令失败:./gradlew app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:从“null”目录运行“npx --quiet --no-install react-native config”命令的意外空结果。:ReactNative: 从“空”目录运行“npx --quiet --no-install react-native config”命令失败。

FAILURE:构建失败,出现异常。

  • 其中:脚本'/node_modules/@react-native-community/cli-platform-android/native_modules.gradle'行:170

  • 出了什么问题:评估脚本时出现问题。

    命令config无法识别。确保你已经运行npm install并且你在一个 react-native 项目中。

mobile android reactjs react-native react-native-android

6
推荐指数
3
解决办法
6万
查看次数

Cloudwatch 洞察查询修改

Current query :
fields  @message
| filter @message like /ABCD/
| stats count(@message)
Run Code Online (Sandbox Code Playgroud)

结果:@messages 1 55 现在需要在此查询中添加更多类似过滤器的内容,例如 /BCDE/,/EFGH/,/IJKL/..... 预期结果应该类似于 @ABCD @BCDE @EFGH @IJKL.. . 55 66 77 88。

可以这样吗?必须在整个 CloudWatch 日志中搜索所有搜索关键字。

amazon-cloudwatch amazon-cloudwatch-metrics

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

3
推荐指数
2
解决办法
9339
查看次数

Powershell pass命令切换为变量

我正在尝试创建一个处理文件夹和文件副本的脚本。我需要通过开关-recures -container,如果它是一个文件夹,什么都不是文件。有没有办法创建一个变量来保存'-recurse -container'并将其传递给命令,如下所示:

$copy_args = '-Recurse -container '
Copy-Item $tmptmp\$file -Destination \\$server\d$\$tmpprd\ $copy_args -Force
Run Code Online (Sandbox Code Playgroud)

谢谢莫

powershell

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

升级到 Spring Boot 2.2.0 抛出 ClassNotFoundException: : org.springframework.integration.handler.support.HandlerMethodArgumentResolversHolder

我用 Spring Boot 2.1.6 编写了我的应用程序,一切正常。但是当我将 Spring Boot 从 2.1.6 升级到 2.2.0 时,我看到了下面的异常。我正在使用 Spring Cloud Greenwich.SR3。有没有人遇到过这种情况?

引起:java.lang.ClassNotFoundException: org.springframework.integration.handler.support.HandlerMethodArgumentResolversHolder at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424)在 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 86 更多

spring-boot

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

由于 MIME 类型(“text/html”)不匹配(X-Content-Type-Options:nosniff),node_modules/primeicons/primeicons.css”被阻止。在角度6

index.html中,我提到了应用样式的链接,并且我正在使用 Angular 6 的 primeng 模块。这里样式不适用,因此会出现如下错误...

\n\n

由于 MIME 类型 \ xe2\x80\x9ctext/html\xe2\x80\x9d) 不匹配(X-Content-Type-Options:nosniff)。

\n\n

同样,我在 index.html 中提到的所有样式表都出现错误。

\n\n

\r\n
\r\n
<!doctype html>\r\n<html lang="en">\r\n\r\n<head>\r\n  <meta charset="utf-8">\r\n  <title>Audit</title>\r\n  <base href="/">\r\n\r\n  <meta name="viewport" content="width=device-width, initial-scale=1">\r\n\r\n  <meta charset="UTF-8">\r\n  <meta name="viewport" content="width=device-width, initial-scale=1">\r\n  <!--===============================================================================================-->\r\n  <link rel="icon" type="image/png" href="images/icons/favicon.ico" />\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">\r\n  <!--===============================================================================================-->\r\n  <link rel="stylesheet" …
Run Code Online (Sandbox Code Playgroud)

angular

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