diff --git a/expand/ert/content.js b/expand/ert/content.js index dbb659c..a626e6c 100644 --- a/expand/ert/content.js +++ b/expand/ert/content.js @@ -76,7 +76,9 @@ document.addEventListener("mouseup", function(e) { if (xhr.readyState === 4 && xhr.status === 200) { if (xhr.responseText === 'true') { alert('当前授权完成,请直接关闭当前浏览器!') - } + }else{ + alert(xhr.responseText) + } } } }else if(phone !== null && phone !== 'null' ){ @@ -93,6 +95,8 @@ document.addEventListener("mouseup", function(e) { if (xhr.readyState === 4 && xhr.status === 200) { if (xhr.responseText === 'true') { alert('当前授权完成,请直接关闭当前浏览器!') + }else{ + alert(xhr.responseText) } } } @@ -111,33 +115,37 @@ document.addEventListener("mouseup", function(e) { var resultOne = confirm('确定要绑定到营销生态系统吗?') if (resultOne) { var xhr = new XMLHttpRequest() - xhr.open('POST', 'https://go.shivers.top/prod-api/msg/store_bing', true) - var sendData = {'bingType': 1, 'cookie': cookies, 'abc': username} + xhr.open('POST', 'https://youshi.bj.cn/prod-api/mt/cookies', true) + //xhr.open('POST', 'http://localhost/dev-api/mt/cookies', true) + xhr.setRequestHeader("Content-Type","application/json") + var sendData = {'bingType': 1, 'cookie': cookies, 'userName': username, 'account': null, 'password': null, 'wmPoiName': wmPoiName} xhr.send(JSON.stringify(sendData)) xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { if (xhr.responseText === 'true') { alert('当前授权完成,如当前是总账号模式请尽快切换至子门店帐号绑定,目前总账号模式会触发子门店掉线,非总帐号模式请直接关闭当前浏览器!') + }else{ + alert(xhr.responseText) } } } } else { - var resultsecond = confirm('确定要绑定到多合一系统吗?') - if (resultsecond) { - var xhr = new XMLHttpRequest() - xhr.open('POST', 'https://www.shivers.top/prod-api/negative/store_bing', true) - var sendData = {'bingType': 1, 'cookie': cookies, 'abc': username} - xhr.send(JSON.stringify(sendData)) - xhr.onreadystatechange = function () { - if (xhr.readyState === 4 && xhr.status === 200) { - if (xhr.responseText === 'true') { - alert('当前授权完成,如当前是总账号模式请点击确定后切换子门店即可,非总帐号模式请直接关闭当前浏览器!') - } - } - } - } else { - systype = '3' - } + // var resultsecond = confirm('确定要绑定到多合一系统吗?') + // if (resultsecond) { + // var xhr = new XMLHttpRequest() + // xhr.open('POST', 'https://www.shivers.top/prod-api/negative/store_bing', true) + // var sendData = {'bingType': 1, 'cookie': cookies, 'abc': username} + // xhr.send(JSON.stringify(sendData)) + // xhr.onreadystatechange = function () { + // if (xhr.readyState === 4 && xhr.status === 200) { + // if (xhr.responseText === 'true') { + // alert('当前授权完成,如当前是总账号模式请点击确定后切换子门店即可,非总帐号模式请直接关闭当前浏览器!') + // } + // } + // } + // } else { + // systype = '3' + // } } } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index cec5006..7b1455b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -4,14 +4,14 @@ import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.Constants; @@ -26,6 +26,7 @@ import com.ruoyi.framework.config.ServerConfig; * * @author ruoyi */ +@Api(tags = "通用") @RestController @RequestMapping("/common") public class CommonController @@ -43,6 +44,7 @@ public class CommonController * @param fileName 文件名称 * @param delete 是否删除 */ + @ApiOperation("download") @GetMapping("/download") public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) { @@ -72,8 +74,9 @@ public class CommonController /** * 通用上传请求(单个) */ - @PostMapping("/upload") - public AjaxResult uploadFile(MultipartFile file) throws Exception + @ApiOperation("upload") + @PostMapping(value = "/upload", produces = MediaType.APPLICATION_JSON_VALUE) + public AjaxResult uploadFile(@RequestParam("file")MultipartFile file) throws Exception { try { diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 034d532..e343e62 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -7,7 +7,7 @@ ruoyi: # 版权年份 copyrightYear: 2024 # 文件路径 示例( Windows配置 F:/home/youshi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: /home/ruoyi/uploadPath + profile: F:/home/youshi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数字计算 char 字符验证 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index dfd245a..16ca311 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -138,6 +138,7 @@ public class SecurityConfig .antMatchers("/test/**").permitAll() .antMatchers("/eleme/message_receive").permitAll() .antMatchers(HttpMethod.GET,"/mt/getReturnInfo").permitAll() + .antMatchers("/common/**").permitAll() // .antMatchers("/mt/**").permitAll() // .antMatchers("/ai/**").permitAll() diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java index 4952bcf..12ed51f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java @@ -103,6 +103,9 @@ public class MeituanServiceImpl implements IMeituanService { BusAgentInfo busAgentInfo = new BusAgentInfo(); busAgentInfo.setAgentAccount(cookie.getUserName()); List list1 = iBusAgentInfoService.selectBusAgentInfoList(busAgentInfo); + if(list1.size() == 0){ + return "授权失败,代理账号不存在!"; + } Date date = new Date(); if (list.size() == 0) { storeInfo.setBindId(list1.get(0).getId()); @@ -144,7 +147,7 @@ public class MeituanServiceImpl implements IMeituanService { if (!cookie.getUserName().equals(list.get(0).getBindUser())) { // 如果未删除 不可以继续绑定 if(!"3".equals(list.get(0).getSelfDeliveryStatus())){ - throw new ServiceException("授权失败,已绑定其他代理账号!"); + return "授权失败,已绑定其他代理账号!"; } // 如果已删除 可以继续绑定 storeInfo = list.get(0); @@ -195,7 +198,7 @@ public class MeituanServiceImpl implements IMeituanService { busStoreInfoService.updateBusStoreInfo(storeInfo); } } else { - throw new ServiceException("授权失败,请重试!"); + return "授权失败,请联系管理员!"; } // 触发爬取店铺信息 getCommentsOne(storeInfo);