生成二维码接口、更换二维码小程序跳转页面

pull/1/head
DataCall 1 year ago
parent b93ed42abe
commit 7a750762b6

@ -1,8 +1,11 @@
package com.cyl.h5.controller;
import cn.hutool.core.util.RandomUtil;
import com.cyl.h5.domain.vo.HomeConfigVO;
import com.cyl.manager.pms.service.ProductCategoryService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.redis.RedisService;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +26,8 @@ public class NoAuthController {
private ProductCategoryService categoryService;
@Autowired
private ISysDictTypeService dictTypeService;
@Autowired
private RedisService redisService;
/**
*
@ -53,9 +58,16 @@ public class NoAuthController {
*
*/
@GetMapping("/app/account/{type}")
public ResponseEntity<String> wmsAccount(@PathVariable String type) {
public ResponseEntity<String> getAppAccount(@PathVariable String type) {
List<SysDictData> sysAppAccount = dictTypeService.selectDictDataByType("sys_app_account");
SysDictData sysDictData = sysAppAccount.stream().filter(it -> it.getDictValue().equals(type)).findFirst().orElseGet(SysDictData::new);
return ResponseEntity.ok(sysDictData.getDictLabel());
}
@GetMapping("/verified/code/generate")
public AjaxResult createCode(){
String code = RandomUtil.randomNumbers(6);
redisService.setVerifyCode(code);
return AjaxResult.successData(code);
}
}

@ -73,7 +73,7 @@ public class WechatAuthService {
String postUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
JSONObject jsonObject = new JSONObject();
jsonObject.put("scene", StringUtils.isEmpty(scene) ? "1" : scene); //可以用作传参,必填,内容随意
jsonObject.put("page", "pages/index/index"); //扫码后跳转页面,选填
jsonObject.put("page", "pages/index/verificationCodeIndex"); //扫码后跳转页面,选填
jsonObject.put("check_path", false); //是否检查跳转页面存不存在
jsonObject.put("env_version", "release"); //版本
byte[] string = null;

Loading…
Cancel
Save