29.后台系统环境搭建
后台系统环境搭建
一、 导入数据库
将资料中的tanhua-admin.sql
引入到mysql数据库中
二、搭建前端环境、导入静态页面
三、搭建后端环境
1.admin实体类
//后台系统的管理员对象
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Admin implements Serializable {
/**
* id
*/
private Long id;
/**
* 用户名
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 头像
*/
private String avatar;
}
2.导入工程,创建bootstrap.yml文件;
spring:
profiles:
active: prod
application:
name: tanhua-admin
cloud:
nacos:
discovery:
server-addr: 192.168.1.8:8848
config:
server-addr: 192.168.1.8:8848
file-extension: yml
3.添加nacos配置
server:
port: 8080 #服务端口
spring:
redis: #redis配置
port: 6379
host: 192.168.136.160
servlet: #这个是配置上传文件大小,SpringBoot内置的tomcat限制了请求文件的大小
multipart:
max-file-size: -1
max-request-size: -1
dubbo:
registry:
address: spring-cloud://localhost
consumer:
check: false #关闭dubbo自动检查机制
cloud:
subscribed-services: 'tanhua-dubbo-db,tanhua-dubbo-mongo'
tanhua:
#默认推荐列表
default:
recommend:
users: 2,3,8,10,18,20,24,29,27,32,36,37,56,64,75,88
sms: #阿里云手机验证码api配置信息
signName: 物流云商
templateCode: SMS_106590012
accessKey: LTAI4GKgob9vZ53k2SZdyAC7
secret: LHLBvXmILRoyw0niRSBuXBZewQ30la
oss: #阿里云oss图片存储的api配置信息
accessKey: LTAI5tB4unCVExN7BqhF46eb
secret: JTPqoNq1j4wIuRktCYRTYpISxQTE1F
bucketName: project-of-tanhua
url: https://project-of-tanhua.oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
aip: #百度云人脸识别api配置信息
appId: 27915129
apiKey: iYbOuyOqi9BsVw4SbAEQifgR
secretKey: Z5kpiL2Fnb1ujQIlcPLjZ9fg0dcAWjaO
huanxin: #环信的即时通信(在线聊天)api配置信息
appkey: 1138221030088106#tanhua
clientId: YXA6Ak-XKvubS225XMjH_0E4TA
clientSecret: YXA6uZpLoPl4akTUnm72hL-XtuiEmgo
# ===================================================================
# 分布式文件系统FDFS配置
# ===================================================================
fdfs:
so-timeout: 1500
connect-timeout: 600
#缩略图生成参数
thumb-image:
width: 150
height: 150
#TrackerList参数,支持多个
tracker-list: 192.168.136.160:22122
web-server-url: http://192.168.136.160:8888/