Commit b536575d authored by daniel's avatar daniel

fix(claimer): 免责模块优化和修复

parent 3332bb26
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<result property="sort" column="sort"></result> <result property="sort" column="sort"></result>
</resultMap> </resultMap>
<select id="queryCmptBycmptId" resultType="Cmpt"> <select id="queryCmptBycmptId" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
SELECT SELECT
cmpt_id cmptId, cmpt_id cmptId,
cmpt_name as cmptName, cmpt_name as cmptName,
......
...@@ -8,7 +8,7 @@ public class RichText { ...@@ -8,7 +8,7 @@ public class RichText {
private Integer id; private Integer id;
private Integer userId; private Integer userId;
private Integer cmptId; private Integer cmptId;
// 类型配置(1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png 7 定位) // 类型配置(1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png 7 定位 8 微信文章)
private Integer type; private Integer type;
// 分类id // 分类id
private Integer moduleId; private Integer moduleId;
......
...@@ -101,7 +101,7 @@ public class BannerService { ...@@ -101,7 +101,7 @@ public class BannerService {
if(partner != null && StringUtils.isNotBlank(partner.getPartnerId())){ if(partner != null && StringUtils.isNotBlank(partner.getPartnerId())){
partnerId = partner.getPartnerId(); partnerId = partner.getPartnerId();
// 限制其他赛事的处理 // 限制其他赛事的处理
if(partnerId != GEEXEK_PARTNER_ID){ if(Objects.equals(partnerId, GEEXEK_PARTNER_ID)||!Objects.equals(banner.getCmptId(), GK_CMPT_ID)){
return null; return null;
} }
} }
......
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
@RequestMapping(value = "/gk/disClaimer/")
@RestController
@ApiIgnore
@Log4j2
public class DisclaimerController {
@Resource
private CmptService cmptService;
@RequestMapping("index/{cmptId}")
@PageView
public ModelAndView index(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.setViewName("cmpt/disClaimer");
mv.addObject("cmpt", cmpt);
return mv;
}
}
...@@ -113,6 +113,7 @@ public class ResourcesController { ...@@ -113,6 +113,7 @@ public class ResourcesController {
// 修改为小程序页面路径 by 2025-06-12 // 修改为小程序页面路径 by 2025-06-12
obj.put("page", "pages/race/raceHome"); obj.put("page", "pages/race/raceHome");
obj.put("width", "1280"); obj.put("width", "1280");
obj.put("check_path", false);
String partnerId = cmptService.getPartnerId(cmptid); String partnerId = cmptService.getPartnerId(cmptid);
try { try {
// 重新获取小程序access_token // 重新获取小程序access_token
......
...@@ -3,6 +3,8 @@ package com.dlbridge.jadp.plugins.common; ...@@ -3,6 +3,8 @@ package com.dlbridge.jadp.plugins.common;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import com.dlbridge.jadp.plugins.cmpt.utils.AliOssUtil; import com.dlbridge.jadp.plugins.cmpt.utils.AliOssUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.neusoft.www.utils.web.Result; import com.neusoft.www.utils.web.Result;
import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
...@@ -22,6 +25,9 @@ import java.util.*; ...@@ -22,6 +25,9 @@ import java.util.*;
@Slf4j @Slf4j
public class CommonController { public class CommonController {
@Resource
private CmptService cmptService;
// 定义允许上传的文件类型及其对应的魔数 // 定义允许上传的文件类型及其对应的魔数
private static final Map<String, byte[]> ALLOWED_FILE_TYPES = new HashMap<>(); private static final Map<String, byte[]> ALLOWED_FILE_TYPES = new HashMap<>();
static { static {
...@@ -96,6 +102,29 @@ public class CommonController { ...@@ -96,6 +102,29 @@ public class CommonController {
return Result.fail().setMsg("文件上传失败"); return Result.fail().setMsg("文件上传失败");
} }
@PostMapping("/uploadClaimer")
@ApiOperation(value = "参赛声明上传")
public Result<?> uploadClaimer(@RequestPart @RequestParam("file") MultipartFile file,@RequestParam(value = "gCmptId") Integer gCmptId) {
try {
String originalFilename = file.getOriginalFilename();
assert originalFilename != null;
// 检查文件名中是否包含点号
int lastIndex = originalFilename.lastIndexOf(".");
if (lastIndex == -1) {
// 如果没有后缀名,直接返回报错信息
return Result.fail().setMsg("上传的文件没有后缀名,请检查文件");
}
String objectName = "micro/" +gCmptId+ "_cmptId/mianze.png";
String filePath = aliOssUtil.upload(file.getBytes(), objectName);
log.info("文件上传名: {} 保存的文件名:{}", originalFilename,filePath);
return Result.success().setContent(filePath);
} catch (IOException e) {
log.error("文件上传失败:{}", e);
}
return Result.fail().setMsg("文件上传失败");
}
/** /**
* 检查文件的魔数是否与扩展名匹配 * 检查文件的魔数是否与扩展名匹配
* @param fileBytes 文件字节数组 * @param fileBytes 文件字节数组
......
This diff is collapsed.
...@@ -454,7 +454,7 @@ ...@@ -454,7 +454,7 @@
<div class="label-box" <div class="label-box"
style="margin-left: 40px;margin-top: 20px;margin-bottom: 20px;"> style="margin-left: 40px;margin-top: 20px;margin-bottom: 20px;">
<select id="openType"> <select id="openType">
<option value="0">文本</option> <option value="8">推文内容</option>
<option value="1">h5</option> <option value="1">h5</option>
<option value="2">小程序</option> <option value="2">小程序</option>
<option value="3">短链接</option> <option value="3">短链接</option>
...@@ -462,6 +462,7 @@ ...@@ -462,6 +462,7 @@
<option value="5">文档</option> <option value="5">文档</option>
<option value="6">图片</option> <option value="6">图片</option>
<option value="7">地图</option> <option value="7">地图</option>
<option value="0">文本</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -537,7 +538,6 @@ ...@@ -537,7 +538,6 @@
<label for="">内容编辑 <span style="color:#ce3939">*</span></label> <label for="">内容编辑 <span style="color:#ce3939">*</span></label>
<div id="container" style="float: right"></div> <div id="container" style="float: right"></div>
</div> </div>
<span id="save" class="save">保存</span> <span id="save" class="save">保存</span>
</div> </div>
</div> </div>
......
...@@ -220,7 +220,6 @@ ...@@ -220,7 +220,6 @@
<span>添加外链项</span> <span>添加外链项</span>
</div> </div>
</div> </div>
<div style="margin-top: -10px;margin-bottom: 50px"> <div style="margin-top: -10px;margin-bottom: 50px">
<table style="width: 100%" class="rule-field"> <table style="width: 100%" class="rule-field">
<colgroup> <colgroup>
...@@ -415,10 +414,10 @@ ...@@ -415,10 +414,10 @@
dialog: false, dialog: false,
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png) // 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc: { typeDesc: {
0: { 8: {
label: '文本', label: '推文文本',
placeholder: '请输入文本内容', placeholder: '请复制推文文本的内容',
desc: '富文本内容', desc: '请复制推文文本的内容',
}, },
1: { 1: {
label: '网页', label: '网页',
...@@ -454,7 +453,13 @@ ...@@ -454,7 +453,13 @@
label: '经纬度', label: '经纬度',
placeholder: '请输入经纬度,逗号隔开', placeholder: '请输入经纬度,逗号隔开',
desc: '请输入文本内容', desc: '请输入文本内容',
} },
0: {
label: '文本',
placeholder: '请输入文本内容',
desc: '富文本内容',
},
}, },
typeOptions: [ typeOptions: [
{ {
......
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
placeholder="请输入小程序appId"> placeholder="请输入小程序appId">
</div> </div>
</div> </div>
<div class="func" v-if="service.type != 0"> <div class="func" v-if="![0,8].includes(service.type)">
<span class="title-new">{{typeDesc[service.type].label}}</span> <span class="title-new">{{typeDesc[service.type].label}}</span>
<div> <div>
<input class="input" type="text" v-model="service.path" <input class="input" type="text" v-model="service.path"
...@@ -581,10 +581,11 @@ ...@@ -581,10 +581,11 @@
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png) // 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc: { typeDesc: {
0: { 8: {
label: '文本', label: '推文文本',
placeholder: '请输入富文本下的内容', placeholder: '请输入推文文本的内容',
}, },
1: { 1: {
label: '网页', label: '网页',
placeholder: '请输入网页地址', placeholder: '请输入网页地址',
...@@ -612,13 +613,18 @@ ...@@ -612,13 +613,18 @@
7: { 7: {
label: '地图', label: '地图',
placeholder: '请输入地址和经纬度', placeholder: '请输入地址和经纬度',
} },
0: {
label: '文本',
placeholder: '请输入富文本下的内容',
},
}, },
typeOptions: [ typeOptions: [
{ {
name: '文本', name: '推文文本',
value: 0, value: 8,
}, },
{ {
name: 'H5', name: 'H5',
value: 1, value: 1,
...@@ -646,6 +652,10 @@ ...@@ -646,6 +652,10 @@
{ {
name: '地图', name: '地图',
value: 7, value: 7,
},
{
name: '文本',
value: 0,
} }
], ],
statusType: { statusType: {
...@@ -935,7 +945,7 @@ ...@@ -935,7 +945,7 @@
layer.msg('上传成功', { icon: 1, time: 1500 }); layer.msg('上传成功', { icon: 1, time: 1500 });
this.$forceUpdate(); // 强制更新视图 this.$forceUpdate(); // 强制更新视图
} else { } else {
layer.msg(res.msg, {icon: 2}); layer.msg(res.msg, { icon: 2 });
} }
}, },
beforeSend: () => { beforeSend: () => {
...@@ -976,7 +986,7 @@ ...@@ -976,7 +986,7 @@
layer.msg('上传成功', { icon: 1, time: 1500 }); layer.msg('上传成功', { icon: 1, time: 1500 });
this.$forceUpdate(); // 强制更新视图 this.$forceUpdate(); // 强制更新视图
} else { } else {
layer.msg(res.msg, {icon: 2}); layer.msg(res.msg, { icon: 2 });
} }
}, },
beforeSend: () => { beforeSend: () => {
......
...@@ -390,6 +390,13 @@ ...@@ -390,6 +390,13 @@
<span class="menu-txt">发枪预约</span> <span class="menu-txt">发枪预约</span>
</a> </a>
</li> </li>
<li class="disClaimer menu-sub-item">
<a
href="/gk/disClaimer/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span>
<span class="menu-txt">免责声明</span>
</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
...@@ -452,7 +459,7 @@ ...@@ -452,7 +459,7 @@
var classes = ['cmptSetting', 'nameList', 'manual', 'contact', 'manage', var classes = ['cmptSetting', 'nameList', 'manual', 'contact', 'manage',
'route', 'road', 'equip', 'photo', 'news', 'cert', 'data', 'route', 'road', 'equip', 'photo', 'news', 'cert', 'data',
'banner', 'score', 'auto', 'scan', 'review', 'customer', 'rule', 'banner', 'score', 'auto', 'scan', 'review', 'customer', 'rule',
'outter-link', 'sure-letter', 'rankSetting', 'service', "module", "swiper", "bag", "invoice", "markNoSelect", "feedback", "markNoRule", "gunRule"]; 'outter-link', 'sure-letter', 'rankSetting', 'service', "module", "swiper", "bag", "invoice", "markNoSelect", "feedback", "markNoRule", "gunRule", "disClaimer"];
let url = document.location.href; let url = document.location.href;
var done = false; var done = false;
for (var i in classes) { for (var i in classes) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment