小编use*_*967的帖子

Spring云,配置服务器无法启动,如何为git配置uri

我对spring cloud项目非常感兴趣,现在我正在测试它,但是立即被阻止了.

  1. 在POM中:我添加了这个依赖:
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-config-server</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)
  1. 主要应用:
@Configuration
@EnableAutoConfiguration
@EnableConfigServer
public class SpringConfigServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringConfigServerApplication.class, args);
    }
}  
Run Code Online (Sandbox Code Playgroud)

所以根据文档,我只需要添加enableConfigServer,然后我尝试启动它,这是错误:

org.springframework.beans.factory.BeanCreationException:在类org.springframework.cloud.config.server.ConfigServerConfiguration中定义名称为'environmentRepository'的bean创建错误$ GitRepositoryConfiguration:init方法的调用失败; 嵌套异常是java.lang.IllegalStateException:您需要为git存储库配置uri

那么,我如何为git存储库配置uri呢?文档中没有提到任何内容.

感谢您提供更多说明

git spring-cloud spring-cloud-config

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

如何在 Mac 中更改 docker 网络 IP 地址

我在 Mac 上运行 Docker 时遇到了一个恼人的问题,希望得到您的帮助。问题是我公司的内部 git 存储库地址为 172.17.28.245,该 IP 地址与默认 docker 网络 IP 地址 172.17.0.0 冲突。所以每当我运行下面的命令时,我都会遇到这个问题

Ping git.xxx.net
Then I have 
PING git.xxx.net (172.17.28.245) 56(84) bytes of data.
From 08be4336c264 (172.17.0.2) icmp_seq=1 Destination Host Unreachable
From 08be4336c264 (172.17.0.2) icmp_seq=2 Destination Host Unreachable
From 08be4336c264 (172.17.0.2) icmp_seq=3 Destination Host Unreachable
Run Code Online (Sandbox Code Playgroud)

那么,谁能帮我弄清楚如何在 mac 中解决这个问题?

我在 Mac 中使用 Docker QuickStart Terminal 来启动。

谢谢

macos networking docker

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

如何摆脱 Angular4 项目的 Eclipse 中的experimentalDecorators警告

我刚刚使用 anglar4 cli 创建一个新项目,并开始出现以下错误。

Experimental support for decorators is a feature that is subject to change in a future release. Set 
 the 'experimentalDecorators' option to remove this warning.
Run Code Online (Sandbox Code Playgroud)

对于每个注释。

我之前没有使用 ng cli,所以我没有看到任何类似的警告。

我检查我的 tsconfig,

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "module": "commonjs",
    "noImplicitAny": false,
    "suppressImplicitAnyIndexErrors": true,
    "typeRoots": [
      "node_modules/@types"
    ],

    "exclude": 
    [
        "node_modules",
        "**/*.spec.ts"
    ],

    "lib": [
      "es2016",
      "dom"
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

没什么特别的。

如何删除 Eclipse …

typescript angular

5
推荐指数
2
解决办法
3842
查看次数

如何使用facebook jest测试.jsx文件,找不到模块

我正在点击此链接来检查如何使用 jest 来测试 React 代码:\n https://facebook.github.io/jest/docs/tutorial-react.html

\n\n

一切都找到了,直到我想测试我们当前的组件。Out组件的写法如下:

\n\n
let React = require(\'react\');\nvar CheckboxWithLabel =  React.createClass({\n    getInitialState: function() {\n        return {\n            isChecked: false\n        }\n    },\n    onChange: function(){\n        this.setState({isChecked: !this.state.isChecked});\n    },\n    render: function(){\n        return (\n                 <label>\n                    <input\n                      type="checkbox"\n                      checked={this.state.isChecked}\n                      onChange={this.onChange}\n                    />\n                    {this.state.isChecked ? this.props.labelOn : this.props.labelOff}\n                  </label>  \n        )\n    }\n});\nmodule.exports = CheckboxWithLabel;\n
Run Code Online (Sandbox Code Playgroud)\n\n

这与教程中的 javasrcript 版本几乎相同,只是我将其更改为 babel 格式。现在,如果我使用这个:

\n\n
jest.unmock("../CheckboxWithLabel");\n\nimport React from \'react\';\nimport ReactDOM from \'react-dom\';\nimport TestUtils from \'react-addons-test-utils\';\nimport CheckboxWithLabel from \'../CheckboxWithLabel\';\n\ndescribe(\'CheckboxWithLabel\', ()=>{\n    it(\'change the text after click\', ()=>{\n         // Render …
Run Code Online (Sandbox Code Playgroud)

ecmascript-6 reactjs jestjs

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

如何将离子项目图标放在行的末尾

这是我的代码:

<ion-item *ngFor="let column of columns" item-icon-right>

            {{column.title}}
            <ion-icon name="star" item-end></ion-icon>
        </ion-item>
Run Code Online (Sandbox Code Playgroud)

我需要的是将图标放在行的远端,但是当我加载页面时,图标仅位于内容的右侧,而不是浮动到整行的右侧。

我关注了ionic doc,但我找不到他们的演示源代码,例如:这里:https: //ionicframework.com/docs/api/components/item/Item/,他们的代码无法生成演示效果。

ionic-framework ionic2

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

如何使用 S3 临时凭证在 Javascript 中上传文件

所有,我尝试使用 S3 临时 Javascript SDK 将文件上传到 S3,但老实说,我找不到任何工作示例,包括 S3 文档。

理想情况下,我应该能够做到这一点:

s3Client = new AWS.client(new TemporaryCredential( keyId, accesskey, token ));

但是我查看了文档,没有地方提到如何使用临时凭证来创建 S3 客户端。

我们公司已经有了获取临时凭证的 api,所以我真的很想知道如何在 javascript 中做到这一点。

我不知道下面的java代码是否有js equivelant解决方案:

BasicSessionCredentials sessionCredentials = new BasicSessionCredentials(
   session_creds.getAccessKeyId(),
   session_creds.getSecretAccessKey(),
   session_creds.getSessionToken());

AmazonS3 s3 = AmazonS3ClientBuilder.standard()
                        .withCredentials(new AWSStaticCredentialsProvider(sessionCredentials)
                        .build();
Run Code Online (Sandbox Code Playgroud)

谢谢你的建议。

javascript amazon-s3 amazon-web-services aws-sdk

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

如何始终通过无效的密钥类型错误生成JWT令牌

我遇到了这个问题,真的不知道如何解决,有人可以帮助您提供有效的解决方案吗?

func GenerateJWT(name, role string) (string, error)  {
    //create a singner for rsa 256
    claims := &jwt.StandardClaims{
        ExpiresAt: 15000,
        Issuer:    "test",
    }

    token :=jwt.NewWithClaims(jwt.SigningMethodES256, claims)
    log.Println("generated toke is ")
    log.Println(token)
    tokenString, err := token.SignedString([]byte("secret"))
....
}
Run Code Online (Sandbox Code Playgroud)

现在我总是有:

密钥类型无效

错误。我在Google上搜索了很多东西,甚至对于jwt-go图书馆本身,他们也提供了完全相同的解决方案,但是为什么我一直拥有

密钥类型无效

错误?

谁能提供有关如何生成jwt令牌的有效示例go

go jwt

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

如何将传单地图背景设置为白色?

我目前正在使用传单来显示数据,总的来说,效果很好,但我们的 PM 希望地图背景为白色而不是灰色。现在,整个地图的背景都是灰色的,我检查了文档,根本找不到有关如何使背景变白的解决方案。非常感谢您的建议。

我看到这是由 tileLayer 引起的,

L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=' + this.props.mapBoxToken, {
            //attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
            maxZoom: 18,
            id: 'mapbox.light'
        })
        .addTo(this.map);
Run Code Online (Sandbox Code Playgroud)

在这里,如果我删除了 tileLayer,则可以看到背景颜色。我在谷歌上搜索了很多如何更改 tilelayer 颜色,但找不到解决方案,希望听到您的建议。

leaflet

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