diff --git a/fuintAdmin_zt/.env.production b/fuintAdmin_zt/.env.production index 0e94c09a0..aa94bd113 100644 --- a/fuintAdmin_zt/.env.production +++ b/fuintAdmin_zt/.env.production @@ -8,7 +8,7 @@ ENV = 'production' VUE_APP_BASE_API = '/fuint-application/' # 发布目录 -VUE_APP_PUBLIC_PATH = '/fuintAdmin/' +VUE_APP_PUBLIC_PATH = '/oilZt/' # 后端接口地址 VUE_APP_SERVER_URL = 'https://www.tuofeng.cc/oilAdmin/' diff --git a/fuintAdmin_zt/src/main.js b/fuintAdmin_zt/src/main.js index 06ac16beb..9f64dc225 100644 --- a/fuintAdmin_zt/src/main.js +++ b/fuintAdmin_zt/src/main.js @@ -49,6 +49,7 @@ Vue.prototype.download = download Vue.prototype.handleTree = handleTree // Vue.prototype.pcUrl = 'http://192.168.0.121:82/' Vue.prototype.pcUrl = 'http://192.168.0.121:82/' +// Vue.prototype.pcUrl = 'http://47.95.206.185:85/' // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/fuintAdmin_zt/src/views/login.vue b/fuintAdmin_zt/src/views/login.vue index 30dcd5604..7c9980954 100644 --- a/fuintAdmin_zt/src/views/login.vue +++ b/fuintAdmin_zt/src/views/login.vue @@ -254,7 +254,8 @@ export default { code:this.loginForm.telcode } this.$store.dispatch("codeLogin", data).then(() => { - this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); + // this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); + this.$router.push({ path: "/Service/index" }).catch(()=>{}); }).catch(() => { this.loading = false; @@ -279,7 +280,8 @@ export default { Cookies.remove('rememberMe'); } app.$store.dispatch("Login", this.loginForm).then(() => { - app.$router.push({ path: this.redirect || "/" }).catch(()=>{}); + // app.$router.push({ path: this.redirect || "/" }).catch(()=>{}); + app.$router.push({ path: "/Service/index" }).catch(()=>{}); }).catch(() => { app.loading = false; if (app.captchaOnOff) { diff --git a/fuintBackend/configure/dev/application.properties b/fuintBackend/configure/dev/application.properties index a963dfee9..27aa3ab0a 100644 --- a/fuintBackend/configure/dev/application.properties +++ b/fuintBackend/configure/dev/application.properties @@ -39,7 +39,7 @@ system.name = \u84DD\u9CB8\u667A\u6167\u6CB9\u7AD9\u7CFB\u7EDF website.url=https://www.fuint.cn/h5/ # \u4E0A\u4F20\u56FE\u7247\u672C\u5730\u5730\u5740 -images.root=d:/rouyi/uploadPath +images.root=d:/ruoyi/uploadPath images.path=/static/uploadImages/ # \u4E0A\u4F20\u56FE\u7247\u670D\u52A1\u5668\u57DF\u540D @@ -124,3 +124,7 @@ weixin.subMessage.pointChange=[{'key':'amount', 'name':'\u53D8\u52A8\u6570\u91CF rocketmq.name-server=127.0.0.1:9876 //2 rocketmq.producer.group=provider + +# \u5458\u5DE5\u7801\u80CC\u666F\u56FE\u8BBE\u7F6E +staff.bg=/static/qrCodeImg/laigeyouhui_bg.jpg +staff.logo=/static/qrCodeImg/logo.png \ No newline at end of file diff --git a/fuintBackend/configure/prod/application.properties b/fuintBackend/configure/prod/application.properties index bf8f2a8ca..831ccf035 100644 --- a/fuintBackend/configure/prod/application.properties +++ b/fuintBackend/configure/prod/application.properties @@ -124,3 +124,7 @@ weixin.subMessage.pointChange=[{'key':'amount', 'name':'\u53D8\u52A8\u6570\u91CF rocketmq.name-server=127.0.0.1:9876 //2 rocketmq.producer.group=provider + +# \u5458\u5DE5\u7801\u80CC\u666F\u56FE\u8BBE\u7F6E +staff.bg=/static/qrCodeImg/laigeyouhui_bg.jpg +staff.logo=/static/qrCodeImg/logo.png \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 5ab13171b..1579b5565 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -22,6 +22,7 @@ import com.fuint.utils.Digests; import com.fuint.utils.Encodes; import jdk.nashorn.internal.parser.Token; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -229,18 +230,23 @@ public class LJStaffServiceImpl extends ServiceImpl impl private SettingService settingService; @Autowired private BackendFileController backendFileController; + @Autowired + private Environment env; @Override public String createStaffQrCode(int id, HttpServletRequest request) throws Exception { + ;; // 根据id查询员工信息和店铺信息 LJStaff staff = this.selectStaffById(id); LJStore store = storeService.selectStoreByStoreId(staff.getStoreId()); //在图片上生成二维码 - String backgroundImage = "D:/ruoyi/qrCode/cailibao_bg.jpg"; - String logoImage = "D:/ruoyi/qrCode/logo.png"; +// String backgroundImage = "/static/qrCodeImg/laigeyouhui_bg.jpg"; +// String logoImage = "/static/qrCodeImg/logo.png"; + String backgroundImage = env.getProperty("staff.bg"); + String logoImage = env.getProperty("staff.logo"); String url = staff.getStaffCode(); String area = store.getName(); - String finalPath="D:/ruoyi/qrCode/" + area + ".jpg"; + String finalPath="D:/qrCode/" + area + ".jpg"; //背景图片路径 loge图片 二维码 输出地址 createLogoCodePicture(backgroundImage, logoImage, url, finalPath, area,store.getAddress()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java index fbb15f50b..53ff5f92c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java @@ -1,5 +1,6 @@ package com.fuint.business.member.utils; +import cn.hutool.core.io.resource.ClassPathResource; import cn.hutool.extra.qrcode.QrCodeUtil; import cn.hutool.extra.qrcode.QrConfig; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; @@ -27,7 +28,10 @@ public class QrCodeUtils { try { // 读取原图片信息 //得到文件 - File file = ResourceUtils.getFile(roundImage); +// File file = ResourceUtils.getFile(roundImage); + ClassPathResource resource = new ClassPathResource(roundImage); + ClassPathResource logoResource = new ClassPathResource(logoImage); + File file = resource.getFile(); //文件转化为图片 Image srcImg = ImageIO.read(file); //获取图片的宽 @@ -39,7 +43,7 @@ public class QrCodeUtils { Graphics2D g = bufImg.createGraphics(); g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null); //使用工具类生成二维码 - Image image = createQrCode(logoImage, url, 360, 360); + Image image = createQrCode(logoResource.getFile().toString(), url, 360, 360); //将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置。 g.drawImage(image, 260, 320, null); // 设置字体,样式,字体大小 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java index 68ffc415c..8cdee6cb6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/storeInformation/service/impl/QRCodeServiceImpl.java @@ -96,7 +96,7 @@ public class QRCodeServiceImpl extends ServiceImpl impleme qrCode.setChainStoreId(store.getChainStoreId()); // 带有店铺id 跳转首页 - qrCode.setCollection("https://www.tuofeng.cc/oilIndex?storeId="+store.getId()); + qrCode.setCollection("https://www.tuofeng.cc/oilStation?storeId="+store.getId()); // 带有店铺id 跳转一键加油页面 qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getId()); row = baseMapper.insert(qrCode); diff --git a/fuintBackend/fuint-application/src/main/resources/static/qrCodeImg/laigeyouhui_bg.jpg b/fuintBackend/fuint-application/src/main/resources/static/qrCodeImg/laigeyouhui_bg.jpg new file mode 100644 index 000000000..1b5696d55 Binary files /dev/null and b/fuintBackend/fuint-application/src/main/resources/static/qrCodeImg/laigeyouhui_bg.jpg differ diff --git a/fuintBackend/fuint-application/src/main/resources/static/qrCodeImg/logo.png b/fuintBackend/fuint-application/src/main/resources/static/qrCodeImg/logo.png new file mode 100644 index 000000000..b5771e209 Binary files /dev/null and b/fuintBackend/fuint-application/src/main/resources/static/qrCodeImg/logo.png differ