后端代码提交
@@ -0,0 +1,47 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
import com.zbkj.common.response.page.PageDiyResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.PageDiyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* DIY数据表 前端控制器
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/front/pagediy")
|
||||
@Api(tags = "DIY 控制器") //配合swagger使用
|
||||
|
||||
public class PageDiyController {
|
||||
|
||||
@Autowired
|
||||
private PageDiyService pageDiyService;
|
||||
/**
|
||||
* 查询DIY数据表信息
|
||||
* @param id Integer
|
||||
* @author dazongzi
|
||||
* @since 2023-05-16
|
||||
*/
|
||||
@ApiOperation(value = "详情")
|
||||
@RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
||||
public CommonResult<PageDiyResponse> info(@PathVariable(value = "id") Integer id){
|
||||
PageDiyResponse response = pageDiyService.getDiyPageByPageIdForFront(id);
|
||||
if(ObjectUtil.isNull(response)) throw new CrmebException("未找到对应模版信息");
|
||||
return CommonResult.success(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.vo.FileResultVo;
|
||||
import com.zbkj.service.service.UploadService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* 上传文件 前端控制器 -- 用户端
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/front/upload")
|
||||
@Api(tags = "用户上传文件")
|
||||
public class UserUploadController {
|
||||
|
||||
@Autowired
|
||||
private UploadService uploadService;
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
@ApiOperation(value = "图片上传")
|
||||
@RequestMapping(value = "/image", method = RequestMethod.POST)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "model", value = "模块 用户user,商品product,微信wechat,news文章"),
|
||||
@ApiImplicitParam(name = "pid", value = "分类ID 0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图,7前台用户,8微信系列 ", allowableValues = "range[0,1,2,3,4,5,6,7,8]")
|
||||
})
|
||||
public CommonResult<FileResultVo> image(MultipartFile multipart,
|
||||
@RequestParam(value = "model") String model,
|
||||
@RequestParam(value = "pid") Integer pid) throws IOException {
|
||||
|
||||
return CommonResult.success(uploadService.imageUpload(multipart, model, pid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*/
|
||||
@ApiOperation(value = "文件上传")
|
||||
@RequestMapping(value = "/file", method = RequestMethod.POST)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "model", value = "模块 用户user,商品product,微信wechat,news文章"),
|
||||
@ApiImplicitParam(name = "pid", value = "分类ID 0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图,7前台用户,8微信系列 ", allowableValues = "range[0,1,2,3,4,5,6,7,8]")
|
||||
})
|
||||
public CommonResult<FileResultVo> file(MultipartFile multipart,
|
||||
@RequestParam(value = "model") String model,
|
||||
@RequestParam(value = "pid") Integer pid) throws IOException {
|
||||
return CommonResult.success(uploadService.fileUpload(multipart, model, pid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zbkj.front.pub;
|
||||
|
||||
import com.zbkj.common.constants.CopyrightConstants;
|
||||
import com.zbkj.common.response.CopyRightResponse;
|
||||
import com.zbkj.common.response.PayConfigResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.SystemConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 公开设置控制器
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/public/config")
|
||||
@Api(tags = "公开设置控制器")
|
||||
public class PubliclyConfigController {
|
||||
|
||||
@Autowired
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@ApiOperation(value = "获取版权")
|
||||
@RequestMapping(value = "/get/copyright", method = RequestMethod.GET)
|
||||
public CommonResult<CopyRightResponse> getCopyright() {
|
||||
CopyRightResponse copyRightResponse = new CopyRightResponse();
|
||||
copyRightResponse.setCopyrightIcpNumber(systemConfigService.getValueByKey(CopyrightConstants.COPYRIGHT_ICP_NUMBER));
|
||||
copyRightResponse.setCopyrightIcpNumberUrl(systemConfigService.getValueByKey(CopyrightConstants.COPYRIGHT_ICP_NUMBER_URL));
|
||||
copyRightResponse.setCopyrightInternetRecord(systemConfigService.getValueByKey(CopyrightConstants.COPYRIGHT_INTERNET_RECORD));
|
||||
copyRightResponse.setCopyrightInternetRecordUrl(systemConfigService.getValueByKey(CopyrightConstants.COPYRIGHT_INTERNET_RECORD_URL));
|
||||
return CommonResult.success(copyRightResponse);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取移动端域名")
|
||||
@RequestMapping(value = "/get/front/domain", method = RequestMethod.GET)
|
||||
public CommonResult<String> getFrontDomain() {
|
||||
return CommonResult.success(systemConfigService.getFrontDomain());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取平台当前的素材地址")
|
||||
@RequestMapping(value = "/get/admin/mediadomain", method = RequestMethod.GET)
|
||||
public CommonResult<String> getMediaDomain() {
|
||||
return CommonResult.success(systemConfigService.getMediaDomain());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.zbkj.front.pub;
|
||||
|
||||
import com.anji.captcha.model.common.ResponseModel;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.SafetyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 安全验证控制器
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/public/safety")
|
||||
@Api(tags = "安全验证控制器")
|
||||
public class SafetyController {
|
||||
|
||||
@Autowired
|
||||
private SafetyService safetyService;
|
||||
|
||||
@ApiOperation(value = "获取行为验证码")
|
||||
@RequestMapping(value = "/get", method = RequestMethod.POST)
|
||||
public CommonResult<ResponseModel> getSafetyCode(@RequestBody com.anji.captcha.model.vo.CaptchaVO data, HttpServletRequest request) {
|
||||
return CommonResult.success(safetyService.getSafetyCode(data, request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "验证行为验证码")
|
||||
@RequestMapping(value = "/check", method = RequestMethod.POST)
|
||||
public CommonResult<ResponseModel> checkSafetyCode(@RequestBody com.anji.captcha.model.vo.CaptchaVO data, HttpServletRequest request) {
|
||||
return CommonResult.success(safetyService.checkSafetyCode(data, request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "行为验证码二次校验")
|
||||
@RequestMapping(value = "/verify", method = RequestMethod.POST)
|
||||
public CommonResult<ResponseModel> verifySafetyCode(@RequestBody com.anji.captcha.model.vo.CaptchaVO data, HttpServletRequest request) {
|
||||
return CommonResult.success(safetyService.verifySafetyCode(data));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.zbkj.front.service.impl;
|
||||
|
||||
import com.anji.captcha.service.CaptchaCacheService;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 对于分布式部署的应用,我们建议应用自己实现CaptchaCacheService,比如用Redis,参考service/spring-boot代码示例。
|
||||
* 如果应用是单点的,也没有使用redis,那默认使用内存。
|
||||
* 内存缓存只适合单节点部署的应用,否则验证码生产与验证在节点之间信息不同步,导致失败。
|
||||
*
|
||||
* ☆☆☆ SPI: 在resources目录新建META-INF.services文件夹(两层),参考当前服务resources。
|
||||
*
|
||||
* @author Han
|
||||
* @version 1.0.0
|
||||
* @Date 2025/6/13
|
||||
*/
|
||||
public class CaptchaCacheServiceRedisImpl implements CaptchaCacheService {
|
||||
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
|
||||
@Override
|
||||
public String type() {
|
||||
return "redis";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void set(String key, String value, long expiresInSeconds) {
|
||||
redisUtil.getRedisTemplate().opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean exists(String key) {
|
||||
return Boolean.TRUE.equals(redisUtil.getRedisTemplate().hasKey(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String key) {
|
||||
redisUtil.getRedisTemplate().delete(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(String key) {
|
||||
return (String) redisUtil.getRedisTemplate().opsForValue().get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long increment(String key, long val) {
|
||||
return redisUtil.getRedisTemplate().opsForValue().increment(key,val);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "wx.miniapp.configs",
|
||||
"type": "java.util.List",
|
||||
"description": "Description for wx.miniapp.configs."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
com.zbkj.front.service.impl.CaptchaCacheServiceRedisImpl
|
||||
68
crmeb/crmeb-front/src/main/resources/application-trip.yml
Normal file
@@ -0,0 +1,68 @@
|
||||
# CRMEB 相关配置
|
||||
crmeb:
|
||||
version: CRMEB-JAVA-KY-v1.4 # 当前代码版本
|
||||
domain: #配合swagger使用 # 待部署域名
|
||||
wechat-api-url: #请求微信接口中专服务器
|
||||
wechat-js-api-debug: false #微信js api系列是否开启调试模式
|
||||
wechat-js-api-beta: true #微信js api是否是beta版本
|
||||
asyncConfig: true #是否同步config表数据到redis
|
||||
asyncWeChatProgramTempList: false #是否同步小程序公共模板库
|
||||
imagePath: /JAVA_PROJECT/SINGLE/trip/admin/ # 服务器图片路径配置 斜杠结尾
|
||||
captchaOn: false # 是否开启行为验证码
|
||||
demoSite: true # 是否演示站点 所有手机号码都会掩码
|
||||
|
||||
server:
|
||||
port: 20510
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
# 配置的环境
|
||||
active: prod
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB #设置单个文件大小
|
||||
max-request-size: 50MB #设置单次请求文件的总大小
|
||||
# 数据库配置
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/java_trip?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: java_trip
|
||||
password: 111111
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 111111
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 5 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-idle: 10 # 连接池中的最大空闲连接
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
time-between-eviction-runs: -1 #逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
|
||||
|
||||
debug: true
|
||||
logging:
|
||||
level:
|
||||
io.swagger.*: error
|
||||
com.zbjk.crmeb: debug
|
||||
org.springframework.boot.autoconfigure: ERROR
|
||||
config: classpath:logback-spring.xml
|
||||
file:
|
||||
path: ./crmeb_log
|
||||
|
||||
# mybatis 配置
|
||||
mybatis-plus:
|
||||
# 配置sql打印日志
|
||||
configuration:
|
||||
log-impl:
|
||||
|
||||
#swagger 配置
|
||||
swagger:
|
||||
basic:
|
||||
enable: true #是否开启界面
|
||||
check: false #是否打开验证
|
||||
username: crmeb #访问swagger的账号
|
||||
password: crmeb.com #访问swagger的密码
|
||||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 58 KiB |
BIN
crmeb/crmeb-front/src/main/resources/fonts/WenQuanZhengHei.ttf
Normal file
55
crmeb/crmeb-front/src/main/resources/fonts/license.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
文泉驿是一个开源汉字字体项目
|
||||
|
||||
由旅美学者房骞骞(FangQ)
|
||||
|
||||
于2004年10月创建
|
||||
|
||||
集中力量解决GNU/Linux
|
||||
|
||||
高质量中文字体匮乏的状况
|
||||
|
||||
目前,文泉驿已经开发并发布了
|
||||
|
||||
第一个完整覆盖GB18030汉字
|
||||
|
||||
(包含27000多个汉字)
|
||||
|
||||
的多规格点阵汉字字型文件
|
||||
|
||||
第一个覆盖GBK字符集的
|
||||
|
||||
开源矢量字型文件(文泉驿正黑)
|
||||
|
||||
并提供了目前包含字符数目最多的
|
||||
|
||||
开源字体——GNU Unifont——中
|
||||
|
||||
绝大多数中日韩文相关的符号
|
||||
|
||||
这些字型文件已经逐渐成为
|
||||
|
||||
主流Linux/Unix发行版
|
||||
|
||||
中文桌面的首选中文字体
|
||||
|
||||
目前Ubuntu、Fedora、Slackware
|
||||
|
||||
Magic Linux、CDLinux
|
||||
|
||||
使用文泉驿作为默认中文字体
|
||||
|
||||
Debian、Gentoo、Mandriva
|
||||
|
||||
ArchLinux、Frugalware
|
||||
|
||||
则提供了官方源支持
|
||||
|
||||
而FreeBSD则在其ports中有提供
|
||||
|
||||
所以,今天我们所要分享的就是
|
||||
|
||||
文泉驿正黑体
|
||||
|
||||
可在Linux/UNIX,Windows
|
||||
|
||||
Mac OS和嵌入式操作系统中使用
|
||||
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
BIN
crmeb/crmeb-front/src/main/resources/images/pic-click/bg6.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
crmeb/crmeb-front/src/main/resources/images/pic-click/bg8.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
crmeb/crmeb-front/src/main/resources/images/pic-click/bg9.png
Normal file
|
After Width: | Height: | Size: 44 KiB |