GraphQL获取用户的IP地址

时间:2018-08-16 12:10:05

标签: java angular spring-boot graphql

我有一个带有GraphQL的新Spring Boot应用程序用于身份验证。我要保存用户的IP地址。如何从GraphQL获取IP地址? WebApp将具有Angular应用程序。也许Angular可以解决这个问题。

以下是pom.xml的重要信息

<dependencies>
    <!-- Spring Boot -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-rest</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!-- GraphQL -->
    <dependency>
        <groupId>com.graphql-java</groupId>
        <artifactId>graphql-spring-boot-starter</artifactId>
        <version>4.2.0</version>
    </dependency>
    <dependency>
        <groupId>com.graphql-java</groupId>
        <artifactId>graphql-java-tools</artifactId>
        <version>5.1.0</version>
    </dependency>
    <dependency>
        <groupId>com.graphql-java</groupId>
        <artifactId>graphiql-spring-boot-starter</artifactId>
        <version>4.2.0</version>
    </dependency>
    <dependency>
        <groupId>com.zhokhov.graphql</groupId>
        <artifactId>graphql-datetime-spring-boot-starter</artifactId>
        <version>1.2.0</version>
    </dependency>
</dependencies>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

0 个答案:

没有答案