A:\program\jdk8\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:A:\ideaIU-2022.3.3\IntelliJ IDEA 2022.3.3\lib\idea_rt.jar=53631:A:\ideaIU-2022.3.3\IntelliJ IDEA 2022.3.3\bin" -Dfile.encoding=UTF-8 -classpath A:\program\jdk8\jre\lib\charsets.jar;A:\program\jdk8\jre\lib\deploy.jar;A:\program\jdk8\jre\lib\ext\access-bridge-64.jar;A:\program\jdk8\jre\lib\ext\cldrdata.jar;A:\program\jdk8\jre\lib\ext\dnsns.jar;A:\program\jdk8\jre\lib\ext\jaccess.jar;A:\program\jdk8\jre\lib\ext\jfxrt.jar;A:\program\jdk8\jre\lib\ext\localedata.jar;A:\program\jdk8\jre\lib\ext\nashorn.jar;A:\program\jdk8\jre\lib\ext\sunec.jar;A:\program\jdk8\jre\lib\ext\sunjce_provider.jar;A:\program\jdk8\jre\lib\ext\sunmscapi.jar;A:\program\jdk8\jre\lib\ext\sunpkcs11.jar;A:\program\jdk8\jre\lib\ext\zipfs.jar;A:\program\jdk8\jre\lib\javaws.jar;A:\program\jdk8\jre\lib\jce.jar;A:\program\jdk8\jre\lib\jfr.jar;A:\program\jdk8\jre\lib\jfxswt.jar;A:\program\jdk8\jre\lib\jsse.jar;A:\program\jdk8\jre\lib\management-agent.jar;A:\program\jdk8\jre\lib\plugin.jar;A:\program\jdk8\jre\lib\resources.jar;A:\program\jdk8\jre\lib\rt.jar;A:\JAVAEE\user-mer\target\classes;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-thymeleaf\2.6.13\spring-boot-starter-thymeleaf-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter\2.6.13\spring-boot-starter-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-logging\2.6.13\spring-boot-starter-logging-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;A:\apache-maven-3.9.9-bin\local\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;A:\apache-maven-3.9.9-bin\local\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;A:\apache-maven-3.9.9-bin\local\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;A:\apache-maven-3.9.9-bin\local\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;A:\apache-maven-3.9.9-bin\local\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;A:\apache-maven-3.9.9-bin\local\org\yaml\snakeyaml\1.29\snakeyaml-1.29.jar;A:\apache-maven-3.9.9-bin\local\org\thymeleaf\thymeleaf-spring5\3.0.15.RELEASE\thymeleaf-spring5-3.0.15.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\thymeleaf\thymeleaf\3.0.15.RELEASE\thymeleaf-3.0.15.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;A:\apache-maven-3.9.9-bin\local\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-web\2.6.13\spring-boot-starter-web-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-json\2.6.13\spring-boot-starter-json-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\core\jackson-databind\2.13.4.2\jackson-databind-2.13.4.2.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\core\jackson-annotations\2.13.4\jackson-annotations-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\core\jackson-core\2.13.4\jackson-core-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.4\jackson-datatype-jdk8-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.4\jackson-datatype-jsr310-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.4\jackson-module-parameter-names-2.13.4.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-tomcat\2.6.13\spring-boot-starter-tomcat-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\apache\tomcat\embed\tomcat-embed-core\9.0.68\tomcat-embed-core-9.0.68.jar;A:\apache-maven-3.9.9-bin\local\org\apache\tomcat\embed\tomcat-embed-el\9.0.68\tomcat-embed-el-9.0.68.jar;A:\apache-maven-3.9.9-bin\local\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.68\tomcat-embed-websocket-9.0.68.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-web\5.3.23\spring-web-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-beans\5.3.23\spring-beans-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-webmvc\5.3.23\spring-webmvc-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-aop\5.3.23\spring-aop-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-context\5.3.23\spring-context-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-expression\5.3.23\spring-expression-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.2.2\mybatis-spring-boot-starter-2.2.2.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-starter-jdbc\2.6.13\spring-boot-starter-jdbc-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-jdbc\5.3.23\spring-jdbc-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-tx\5.3.23\spring-tx-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.2.2\mybatis-spring-boot-autoconfigure-2.2.2.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\mybatis\3.5.9\mybatis-3.5.9.jar;A:\apache-maven-3.9.9-bin\local\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-devtools\2.6.13\spring-boot-devtools-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot\2.6.13\spring-boot-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\boot\spring-boot-autoconfigure\2.6.13\spring-boot-autoconfigure-2.6.13.jar;A:\apache-maven-3.9.9-bin\local\com\mysql\mysql-connector-j\8.0.33\mysql-connector-j-8.0.33.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-core\5.3.23\spring-core-5.3.23.jar;A:\apache-maven-3.9.9-bin\local\org\springframework\spring-jcl\5.3.23\spring-jcl-5.3.23.jar com.ljy.UserManagementSystemApplication 11:23:24.929 [Thread-1] DEBUG org.springframework.boot.devtools.restart.classloader.RestartClassLoader - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@4cd1c1d7 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.6.13) 2025-05-27 11:23:25.135 INFO 14136 --- [ restartedMain] com.ljy.UserManagementSystemApplication : Starting UserManagementSystemApplication using Java 1.8.0_411 on LAPTOP-LAKGK45S with PID 14136 (A:\JAVAEE\user-mer\target\classes started by 华硕 in A:\JAVAEE\user-mer) 2025-05-27 11:23:25.137 INFO 14136 --- [ restartedMain] com.ljy.UserManagementSystemApplication : No active profile set, falling back to 1 default profile: "default" 2025-05-27 11:23:25.166 INFO 14136 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2025-05-27 11:23:25.166 INFO 14136 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2025-05-27 11:23:25.809 INFO 14136 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2025-05-27 11:23:25.814 INFO 14136 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2025-05-27 11:23:25.814 INFO 14136 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.68] 2025-05-27 11:23:25.865 INFO 14136 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2025-05-27 11:23:25.865 INFO 14136 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 699 ms 2025-05-27 11:23:25.908 WARN 14136 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [A:\JAVAEE\user-mer\target\classes\com\ljy\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class 2025-05-27 11:23:25.909 INFO 14136 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-05-27 11:23:25.918 INFO 14136 --- [ restartedMain] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-05-27 11:23:25.929 ERROR 14136 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). 进程已结束,退出代码0 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ljy</groupId> <artifactId>user-mer</artifactId> <version>0.0.1-SNAPSHOT</version> <name>user-mer</name> <description>user-mer</description> <properties> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <spring-boot.version>2.6.13</spring-boot.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.33</version> <!-- 最新版本可查 Maven 仓库 --> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <!-- 添加资源过滤配置 --> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.html</include> <!-- 确保HTML文件被打包 --> </includes> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> <configuration> <mainClass>com.ljy.UserManagementSystemApplication</mainClass> <skip>false</skip> </configuration> <executions> <execution> <id>repackage</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> # application.yml server: port: 8080 # application.yml 数据库配置 spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/user_db?useSSL=false&serverTimezone=Asia/Shanghai username: root password: 123456 thymeleaf: prefix: classpath:/templates/ suffix: .html cache: false mybatis: mapper-locations: classpath:mapper/*.xml type-aliases-package: com.ljy.pojoCREATE DATABASE user_db CHARACTER SET utf8mb4; USE user_db; CREATE TABLE user ( id INT PRIMARY KEY AUTO_INCREMENT, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, email VARCHAR(100), avatar_url VARCHAR(200) ); -- 插入测试管理员(admin/123456) INSERT INTO user (username, password, email) VALUES ('admin', '123456', '[email protected]');直接告诉我问题在哪里 我该怎么解决
时间: 2025-08-10 16:23:40 浏览: 22
<think>好的,我现在需要帮助用户解决Spring Boot项目启动时出现的数据库驱动类配置错误的问题。用户提到错误信息是'Failed todetermine asuitable driverclass',这通常和数据源配置有关。我需要结合用户提供的引用内容,分析可能的原因,并给出解决方案。首先,引用[1]和[2]中提到,当数据源的url没有正确配置时,会导致无法找到合适的驱动类。用户可能在application.yml或application.properties中没有正确设置spring.datasource.url,或者格式有误。比如,在引用[2]中,用户配置了url,但仍然报错,可能是因为在application.properties中使用了错误的语法,比如冒号后面没有空格,或者使用了不正确的转义符号,比如&amp;应该用&。其次,驱动类名称是否正确也是一个关键点。引用[1]和[3]指出,驱动类名是否与MySQL连接器版本匹配。例如,旧版本的MySQL驱动使用com.mysql.jdbc.Driver,而新版本(8.0以上)需要使用com.mysql.cj.jdbc.Driver。用户可能在配置中使用了旧的驱动类名,但实际依赖的是新版本的驱动,或者相反。第三,检查是否添加了MySQL连接器的依赖。如果pom.xml或build.gradle中没有正确引入MySQL的JDBC驱动,即使配置正确,也会找不到驱动类。需要确认依赖的版本是否正确,比如是否使用了MySQL8.x对应的驱动。
另外,引用[4]中的例子展示了多数据源配置,但用户可能只是单数据源,但配置中存在其他问题,比如多环境配置未激活导致数据源配置未被加载。或者,可能没有排除SpringBoot的自动配置,比如在启动类上需要添加@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}),尤其是在多数据源情况下,但用户如果单数据源可能不需要这个,但错误配置可能导致冲突。
此外,查看用户提供的引用[2],他们的application.properties中使用了spring.datasource.type指定了Druid数据源,但配置可能存在语法错误,比如在properties文件中使用冒号而不是等号,或者缩进不正确,导致配置未被正确读取。例如,在properties文件中应该使用key=value的格式,而用户示例中使用了类似YAML的缩进结构,这会导致配置失效,从而无法读取url,进而引发驱动类错误。
还有,用户是否在配置文件中激活了正确的profile,比如spring.profiles.active=dev,而对应的dev配置文件没有正确配置数据源,导致默认配置中没有url,从而报错。引用[1]中的问题3提到可能需要激活特定的profile。接下来,可能的解决方案包括:
1.检查数据库URL和驱动类名是否正确,确保驱动类名与MySQL版本匹配。
2.确认MySQL连接器依赖已正确添加,版本与驱动类对应。
3.检查配置文件语法,确保在YAML中使用正确的缩进,在properties文件中使用正确的键值对格式。4.确保没有不必要的自动配置排除,比如引用[2]中的启动类排除了DataSourceAutoConfiguration,这可能导致数据源无法自动配置,除非手动配置了数据源Bean。5.检查是否激活了正确的配置文件,确保数据源配置在激活的环境中。
另外,用户提到的错误信息中提示无法确定合适的驱动类,可能还有驱动类未被正确加载的情况,比如依赖未正确下载或引入,或者项目构建时未包含该依赖。需要逐步引导用户检查这些可能的点,并提供具体的配置示例,比如正确的驱动类名、依赖配置,以及配置文件的正确写法。同时,提醒用户注意配置文件中的特殊字符转义,比如在URL中的参数是否使用正确的&符号而不是转义后的形式。
最后,生成相关问题,帮助用户进一步排查可能的问题,比如多数据源配置、配置文件优先级、依赖管理等。</think>### Spring Boot数据源配置错误解决方案
当出现`Failed to determine a suitable driver class`错误时,需按以下步骤排查:
---
#### **1. 检查数据库驱动类名**
- **MySQL 5.x** 使用旧版驱动类:
```yaml
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
```
- **MySQL 8.x** 必须使用新版驱动类[^3]:
```yaml
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
```
> 注意:若驱动类名与MySQL版本不匹配,会导致无法加载驱动。
---
#### **2. 验证数据库连接URL**
- **MySQL 8.x** 必须添加时区参数:
```yaml
spring.datasource.url=jdbc:mysql://localhost:3306/db_name?useSSL=false&serverTimezone=Asia/Shanghai
```
> 错误示例:`jdbc:mysql://localhost:3306/db_name`(缺少时区配置)[^3]
---
#### **3. 添加MySQL依赖**
在`pom.xml`中确认已引入正确的MySQL连接器:
```xml
<!-- MySQL 8.x -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency>
<!-- MySQL 5.x -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
</dependency>
```
---
#### **4. 排除自动配置干扰**
若使用多数据源或自定义数据源,需在启动类排除自动配置:
```java
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
```
> 注意:单数据源项目无需此配置[^2]。
---
#### **5. 配置文件格式问题**
- **YAML** 必须使用严格缩进(2空格):
```yaml
spring:
datasource:
url: jdbc:mysql://localhost:3306/db_name
```
- **Properties** 需使用`=`符号:
```properties
spring.datasource.url=jdbc:mysql://localhost:3306/db_name
```
---
#### **6. 激活配置文件**
若使用多环境配置,需指定激活的Profile:
```yaml
spring.profiles.active=dev
```
> 确保`application-dev.yml`中包含完整数据源配置[^1]。
---
### 常见错误场景示例
| 错误类型 | 错误示例 | 修正方案 |
|---------|----------|----------|
| 驱动类名错误 | `com.mysql.jdbc.Driver`(MySQL 8.x) | 改为`com.mysql.cj.jdbc.Driver`[^3] |
| URL缺少时区 | `jdbc:mysql://localhost:3306/db` | 添加`?serverTimezone=Asia/Shanghai` |
| 依赖缺失 | 未添加`mysql-connector-java` | 检查`pom.xml`依赖 |
---
阅读全文
相关推荐

















