| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.ObjectUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | |
| | | * @Version 1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="app管理") |
| | | @Api(tags = "app管理") |
| | | @RestController |
| | | @RequestMapping("/app/manage") |
| | | @AllArgsConstructor |
| | |
| | | */ |
| | | @ApiOperation(value = "app管理-获取微信小程序跳转链接", notes = "app管理-获取微信小程序跳转链接") |
| | | @GetMapping(value = "/getMiniProgramPath") |
| | | public R getMiniProgramPath(){ |
| | | public R getMiniProgramPath() { |
| | | String wxAccessToken = WxUtils.getWxAccessToken(); |
| | | |
| | | String url = WxUtils.WX_GET_GENERATESCHEME+"?access_token="+wxAccessToken; |
| | | |
| | | String url = WxUtils.WX_GET_GENERATESCHEME + "?access_token=" + wxAccessToken; |
| | | RestTemplate template = new RestTemplate(); |
| | | Map<String, Object> params = new LinkedHashMap<>(); |
| | | |
| | |
| | | */ |
| | | JSONObject jump_wxa = new JSONObject(); |
| | | |
| | | jump_wxa.put("path","/pages/home/index"); |
| | | jump_wxa.put("query",""); |
| | | jump_wxa.put("env_version","release"); |
| | | |
| | | params.put("jump_wxa",jump_wxa); |
| | | params.put("is_expire",true); |
| | | params.put("expire_type",1); |
| | | params.put("expire_interval",1); |
| | | |
| | | jump_wxa.put("path", "/pages/home/index"); |
| | | jump_wxa.put("query", ""); |
| | | jump_wxa.put("env_version", "release"); |
| | | params.put("jump_wxa", jump_wxa); |
| | | params.put("is_expire", true); |
| | | params.put("expire_type", 1); |
| | | params.put("expire_interval", 1); |
| | | String result = template.postForObject(url, params, String.class); |
| | | JSONObject resultObj = (JSONObject)JSONObject.parse(result); |
| | | JSONObject resultObj = (JSONObject) JSONObject.parse(result); |
| | | String openLink = resultObj.getString("openlink"); |
| | | Integer code = resultObj.getInteger("errCode"); |
| | | if (code.equals(0)) { |
| | | return R.data(openLink); |
| | | } else { |
| | | return R.fail(""); |
| | | } |
| | | |
| | | return R.data(openLink); |
| | | } |
| | | |
| | | } |