https://gitee.com/davidzhe/wedding-invitation-
官方虽然有介绍但是非常坑,我标注出坑位
1.用idea加载项目文件
2.配置数据库。用小皮安装mysql5.7.22 字符集选择 utf8mb4,用户名root 密码123456。使用idea的mysql连接器链接mysql填入用户名密码,连接成功后,点击sql图标,写入
create database marryii;
执行
在idea的项目文件列表根目录下中找到marryii.sql,右键运行,选择数据库marryii,等待运行成功
3.修改两个配置文件 \ruoyi-admin\src\main\resources\application.yml和application-druid.yml
application.yml
server:
# 服务器的HTTP端口,默认为80
port: 8080
ssl:
enabled: false
修改提示错误语法的×号删除、
4.修改RuoYiApplication文件
打开
/*
//此处往下的代码,是http自动跳https==========================================================
@Value("${http.port}")
Integer httpPort;
@Value("${server.port}")
Integer httpsPort;
@Bean
public TomcatServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
@Override
protected void postProcessContext(Context context) {
SecurityConstraint constraint = new SecurityConstraint();
constraint.setUserConstraint("CONFIDENTIAL");
SecurityCollection collection = new SecurityCollection();
collection.addPattern("/*");
constraint.addCollection(collection);
context.addConstraint(constraint);
}
};
tomcat.addAdditionalTomcatConnectors(httpConnector());
return tomcat;
}
@Bean
public Connector httpConnector() {
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
connector.setScheme("http");
//Connector监听的http的端口号
connector.setPort(httpPort);
connector.setSecure(false);
//监听到http的端口号后转向到的https的端口号
connector.setRedirectPort(httpsPort);
return connector;
}
//============================================================================================================================
*/
编译运行程序
4.登录并配置。地址127.0.0.1:8080/party,登录用户名admin 密码 admin123。配置基本信息,注意一定要配置apptd否则获取不到访客用户的openid
将E:\wedding-invitation--master\ruoyi-marry导入