小编Jav*_*hip的帖子

由于私人git仓库ssh和https连接,npm安装失败

我有以下package.json文件,我正在尝试运行npm install,但失败。

    "test": "git+https://<TOKEN>@github.build.test.com/test.git",
Run Code Online (Sandbox Code Playgroud)

我有与github匹配的ssh密钥。但是,即使我编写以下内容,它也始终使用https运行。

    "test": "git+ssh://git@github.build.test.com/test.git",
Run Code Online (Sandbox Code Playgroud)

在两种情况下,我都会遇到以下错误消息

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.build.test.com/test.git
npm ERR!
npm ERR! remote: Password authentication is not available for Git operations.
npm ERR! remote: You must use a personal access token or SSH key.
npm ERR! remote: See https://github.build.test.com/settings/tokens or https://github.build.test.com/settings/ssh
npm ERR! fatal: unable to access 'https://github.build.test.com/test.git/': The requested URL returned error: 403
npm ERR!
npm ERR! exited with error code: 128
Run Code Online (Sandbox Code Playgroud)

如果我单独运行上面的命令,它可以工作。

git ls-remote -h …
Run Code Online (Sandbox Code Playgroud)

git ssh npm package.json

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

多线程Spring事务

假设我们进入一个方法并在主线程中启动事务。在此方法中,有一些异步方法,因此我们在该方法内又创建了2个线程;

                 Thread 1 --> SubMethod1 --> Saving (t=1)
                   ^
                   |
MainThread --> MainMethod --> Saving (t=3)
                   |
                   v   
                 Thread 2 --> SubMethod2 --> Exception while saving (t=2).
Run Code Online (Sandbox Code Playgroud)

由于线程2发生异常,因此我想回滚其他线程完成的所有事务。但是,尽管可以回滚线程2的主线程拥有的事务,但我无法回滚线程1的工作。我正在使用Spring / Hibernate,所以您有什么想法来进行管理以及如何应用?

谢谢

java spring multithreading hibernate spring-transactions

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

带模板的 V 型

我正在使用 vue-bootstrap。我尝试创建动态的网格组件来获取标题和数据。由于我们不知道有多少列传递给组件,因此我们应该检查传递的每个项目。

<template>
    <b-table striped hover :items="items"></b-table>
        <div v-for="title in items">
          <template slot="title.key" slot-scope="data">
            <input v-if="title.isActive" type="text" v-model="data.value">
            <textarea v-else type="text" v-model="data.value"></textarea>
          </template>
        </div>
   </b-table>
</template>

<script>
const items =[
      {'label': 'Description', 'key': 'description'},
      {'label': 'Name',  'key': 'name', 'isActive': true},
    ]
Run Code Online (Sandbox Code Playgroud)

因此,如果 isActive 为 true,则此模板应该是 textarea(列应使用 textarea 而不是 input 进行更改)但是它不起作用,并且没有列更改 inputbox 和 textarea 并保持默认模板

您能帮忙解答一下这些问题吗?

谢谢

vue.js vue-component vuejs2 bootstrap-vue

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