diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue index 7151eea4a..68bb45ab4 100644 --- a/fuintAdmin/src/views/member/userInfo.vue +++ b/fuintAdmin/src/views/member/userInfo.vue @@ -181,14 +181,15 @@ + @input="valueAmoutChange(cardValueForm.amount)" + + > -
@@ -900,16 +901,23 @@ export default { this.cardValueList = this.cardValueList.filter(item => { return item.membershipLevel.includes(this.grade.name); }); + console.log("this.cardValueList",this.cardValueList) this.rechargeCard(0); } }, valueAmoutChange(data) { - if(data == '' || data == null) { - data = 0 + // this.cardValueForm.amount = null + this.$set(this.cardValueForm, 'amount', data); + + console.log("data17.16",this.cardValueForm.amount) + if(!data) { this.cardValueForm.amount = 0 + }else { + this.cardValueForm.amount = data } + this.cardValueForm.points = '' this.cardValueForm.bidBalance ='' @@ -1053,6 +1061,10 @@ export default { } if (this.cardValueForm.amount != null) { this.cardValueForm.rechargeType = 1 + if (!this.cardValueForm.amount || this.cardValueForm.amount<0) { + this.$message.error('请选择输入自定义金额'); + return + } this.realyPayBills = this.cardValueForm.amount } else { this.cardValueForm.rechargeType = 0 @@ -1118,8 +1130,8 @@ export default { // 选择余额充值金额 rechargeCard(index,item){ - // console.log("index",index) - this.cardValueForm.amount = null, + console.log("index",index) + // this.cardValueForm.amount = null, this.cardValueForm.rechargeType = 0 this.activeKey = index; @@ -1131,9 +1143,10 @@ export default { this.cardValueForm.bidBalance = 0 // this.cardValueForm.bidBalance = 1 - this.cardValueForm.amount = 0 + // this.cardValueForm.amount = 0 }else { + if (this.cardValueList <= 0) return let file={} // 拿到金额 file = this.cardValueList[index] @@ -1186,6 +1199,11 @@ export default { let userForm = this.form + if(!this.authCode && this.cardValueForm.paymentType != "CASH") { + this.$message.error('请先扫码'); + return + } + if (this.flag === 1) { // 会员id 会员名字会员手机号码 this.cardValueForm.mtUserId = userForm.id @@ -1323,10 +1341,31 @@ export default { this.authCode = null this.activeRecharge='balance', - this.cardValueForm = {} + this.iniz() this.cardFuelDieselForm = {} }, + iniz() { + this.cardValueForm= { + cardValueId:'', // 储值卡id + mtStaffId: '', // + realName: '', + staffMobile: '', + amount:'', // 自定义充值字段 + bidBalance:'', // 储值卡面值 + rechargeBalance:'', // 实际支付 + giftBalance:'',// 赠送金额 + points:'', //赠送积分 + growthValue:'', // 赠送成长值 + remark:'', + paymentType:'', // 支付方式 + royaltyType: '',// 提成类型 + percentageCommissions:null, + amountCommission:null, + rechargeType:'0' + } + }, + // 提交按钮 submitForm: function() { this.$refs["form"].validate(valid => { diff --git a/fuintBackend/configure/dev/application.properties b/fuintBackend/configure/dev/application.properties index f46b177a9..c6d041c2c 100644 --- a/fuintBackend/configure/dev/application.properties +++ b/fuintBackend/configure/dev/application.properties @@ -1,6 +1,6 @@ # 数据库配置 -spring.datasource.url=jdbc:mysql://192.168.1.5:3306/fuint-db?useUnicode=true&characterEncoding=UTF8&useSSL=false&allowMultiQueries=true +spring.datasource.url=jdbc:mysql://192.168.1.3:3306/fuint-db?useUnicode=true&characterEncoding=UTF8&useSSL=false&allowMultiQueries=true spring.datasource.username=root spring.datasource.password=qqzcy@1014 diff --git a/fuintBackend/fuint-application/pom.xml b/fuintBackend/fuint-application/pom.xml index 7c59148f2..13d4239fe 100644 --- a/fuintBackend/fuint-application/pom.xml +++ b/fuintBackend/fuint-application/pom.xml @@ -84,6 +84,13 @@ ${mybatis-plus.version} + + + + + + + com.github.pagehelper pagehelper-spring-boot-starter @@ -177,6 +184,8 @@ 2.1.0 + + diff --git a/fuintBackend/fuint-application/src/main/resources/application.properties b/fuintBackend/fuint-application/src/main/resources/application.properties index 95895f351..8797f5ad3 100644 --- a/fuintBackend/fuint-application/src/main/resources/application.properties +++ b/fuintBackend/fuint-application/src/main/resources/application.properties @@ -1,5 +1,5 @@ # \u57FA\u672C\u914D\u7F6E -server.port=8080 +server.port=8008 env.profile=dev env.properties.path=D:/code/oilSystem/fuintBackend/configure/ @@ -24,3 +24,49 @@ mybatis-plus.mapper-locations = classpath*:/mapper/*Mapper.xml,classpath*:com/fu mybatis-plus.configuration.intercepts=com.example.MyInterceptor # \u9ED8\u8BA4\u65F6\u95F4\u683C\u5F0F spring.jackson.date-format=yyyy-MM-dd HH:mm:ss + +##rocketmq???? +#?????????? +#rocketmq.producer.isOnOff=on +# ????? +rocketmq.name-server=47.95.206.185:9876 + +#rocketmq.producer.namesrvAddr=47.95.206.185:9876 +rocketmq.producer.groupName=anran-producer-group +rocketmq.producer.group=anran-producer-group +rocketmq.producer.topic=anran-topic +# ???? +rocketmq.producer.sync-tag=anran-sync-tags +# ???? +rocketmq.producer.async-tag=anran-async-tags +#?????? ??1024*4(4M) +rocketmq.producer.maxMessageSize=4096 +#????????,??3000 +rocketmq.producer.sendMsgTimeout=3000 +#?????????????2 +rocketmq.producer.retryTimesWhenSendFailed=2 + + + + +# ????? +rocketmq.consumer.group=anran-consumer-group +rocketmq.consumer.topic=anran-topic +# ?????????????? Topic????????????? Tag +rocketmq.consumer.tags=anran-sync-tags,anran-async-tags + + + + +####consumer +###?????????? +#rocketmq.consumer.isOnOff=on +#rocketmq.consumer.groupName=${spring.application.name} +##mq?nameserver?? +#rocketmq.consumer.namesrvAddr=127.0.0.1:9876 +##??????????tags("*"????????????tags),???topic~tag1||tag2||tag3;topic2~*; +#rocketmq.consumer.topics=DemoTopic~*; +#rocketmq.consumer.consumeThreadMin=20 +#rocketmq.consumer.consumeThreadMax=64 +##???????????????1? +#rocketmq.consumer.consumeMessageBatchMaxSize=1 \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/test/java/aes.java b/fuintBackend/fuint-application/src/test/java/aes.java index fadccbf89..a61bdff95 100644 --- a/fuintBackend/fuint-application/src/test/java/aes.java +++ b/fuintBackend/fuint-application/src/test/java/aes.java @@ -1,2 +1,64 @@ -package PACKAGE_NAME;public class aes { +import com.fuint.fuintApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.util.Base64; + +@RunWith(SpringJUnit4ClassRunner.class) +//@RunWith(SpringRunner.class) +@SpringBootTest(classes = fuintApplication.class) +@Transactional +public class aes { + + public String ALGORITHM = "AES"; + public static final String TRANSFORMATION = "AES/CBC/PKCS5Padding"; + public static final String SECRET_KEY = "0123456789abcdef"; // 16位 + public static final String IV = "0123456789abcdef"; // 16位 + @Test + public void tt() throws Exception { + String originalData = "hello 123"; + + // 加密 + String encryptedData = null; + try { + encryptedData = encrypt(originalData); + } catch (Exception e) { + e.printStackTrace(); + } + System.out.println("Encrypted Data: " + encryptedData); + + // 解密 + String decryptedData = decrypt(encryptedData); + System.out.println("Decrypted Data: " + decryptedData); + } + + + public String encrypt(String data) throws Exception { + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + SecretKeySpec keySpec = new SecretKeySpec(SECRET_KEY.getBytes(), ALGORITHM); + IvParameterSpec ivSpec = new IvParameterSpec(IV.getBytes()); + + cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec); + byte[] encryptedBytes = cipher.doFinal(data.getBytes()); + + return Base64.getEncoder().encodeToString(encryptedBytes); + } + + public String decrypt(String encryptedData) throws Exception { + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + SecretKeySpec keySpec = new SecretKeySpec(SECRET_KEY.getBytes(), ALGORITHM); + IvParameterSpec ivSpec = new IvParameterSpec(IV.getBytes()); + + cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); + byte[] decodedBytes = Base64.getDecoder().decode(encryptedData); + + return new String(cipher.doFinal(decodedBytes)); + } + } diff --git a/fuintBackend/pom.xml b/fuintBackend/pom.xml index 901074ed5..803830099 100644 --- a/fuintBackend/pom.xml +++ b/fuintBackend/pom.xml @@ -85,12 +85,20 @@ 3.1.0 + io.swagger swagger-annotations 1.5.21 + + + org.redisson + redisson-spring-boot-starter + 3.16.2 + + io.swagger swagger-models @@ -184,6 +192,12 @@ 2.2.1 + + + + + + com.github.wxpay diff --git a/gasStation-uni/config.js b/gasStation-uni/config.js index cdfca48e2..d604a3bad 100644 --- a/gasStation-uni/config.js +++ b/gasStation-uni/config.js @@ -2,8 +2,8 @@ module.exports = { // baseUrl: 'https://vue.ruoyi.vip/prod-api', - baseUrl: 'http://192.168.0.196:8080/', - // baseUrl: 'http://192.168.1.6:8008/', + // baseUrl: 'http://192.168.0.196:8080/', + baseUrl: 'http://192.168.1.6:8008/', // baseUrl: 'http://192.168.1.5:8002/cdJdc', imagesUrl: 'http://www.nuoyunr.com/lananRsc', // 应用信息 diff --git a/gasStation-uni/package-lock.json b/gasStation-uni/package-lock.json index a12266854..3e8281a93 100644 --- a/gasStation-uni/package-lock.json +++ b/gasStation-uni/package-lock.json @@ -83,6 +83,11 @@ "readdirp": "~3.6.0" } }, + "crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", diff --git a/gasStation-uni/package.json b/gasStation-uni/package.json index 3de8b266f..c0774a78e 100644 --- a/gasStation-uni/package.json +++ b/gasStation-uni/package.json @@ -2,6 +2,7 @@ "dependencies": { "@dcloudio/uni-ui": "^1.4.28", "bignumber.js": "^9.1.2", + "crypto-js": "^4.2.0", "uview-ui": "^2.0.36" }, "devDependencies": {