java 解决微信不能重定向resposne.sendRedirect的问题

以前一个二维码控制两种下载渠道是这么玩的:通过resposne.sendRedirect跳转,结果微信一扫,就被拦截了,好尴尬啊~

/**
	 * 二维码下载两种app
	 * @param request
	 * @param resposne
	 */
	@RequestMapping(value="download")
	public void ApkDownloadCount(HttpServletRequest request,HttpServletResponse resposne){
		String userAgent = request.getHeader("User-Agent");
		try{
			if(!StringUtils.isEmpty(userAgent)&&userAgent.contains("iPhone")){
				try{
					resposne.sendRedirect("https://itunes.apple.com/us/app/yi-jian-ru-gu-ai-qing-she/id1005211959?mt=8&uo=4");

					return;
				}catch (Exception e) {
					e.printStackTrace();
				}
			}else{
				resposne.sendRedirect("http://121.40.129.68:8080/imgs/download/YiJianRuGu.apk");

				return;
			}
		}catch(Exception ex){
			ex.printStackTrace();
		}
	}



这次来新公司后:这是一个配置应用宝推广链接的的二维码,用微信扫后打开应用宝,如果是苹果机直接去appstore了~~


应用宝后台推广界面:



太好了,瞬间有张姿势了~哈哈~~

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
解释一下这段代码function [params, bg_area, fg_area, area_resize_factor] = initializeAllAreas(im, params) % we want a regular frame surrounding the object avg_dim = sum(params.target_sz)/2; % size from which we extract features bg_area = round(params.target_sz + avg_dim); % pick a "safe" region smaller than bbox to avoid mislabeling fg_area = round(params.target_sz - avg_dim * params.inner_padding); % saturate to image size if(bg_area(2)>size(im,2)), bg_area(2)=size(im,2)-1; end if(bg_area(1)>size(im,1)), bg_area(1)=size(im,1)-1; end % make sure the differences are a multiple of 2 (makes things easier later in color histograms) bg_area = bg_area - mod(bg_area - params.target_sz, 2); fg_area = fg_area + mod(bg_area - fg_area, 2); % Compute the rectangle with (or close to) params.fixedArea and % same aspect ratio as the target bbox area_resize_factor = sqrt(params.fixed_area/prod(bg_area)); params.norm_bg_area = round(bg_area * area_resize_factor); % Correlation Filter (HOG) feature space % It smaller that the norm bg area if HOG cell size is > 1 params.cf_response_size = floor(params.norm_bg_area / params.hog_cell_size); % given the norm BG area, which is the corresponding target w and h? norm_target_sz_w = 0.75*params.norm_bg_area(2) - 0.25*params.norm_bg_area(1); norm_target_sz_h = 0.75*params.norm_bg_area(1) - 0.25*params.norm_bg_area(2); % norm_target_sz_w = params.target_sz(2) * params.norm_bg_area(2) / bg_area(2); % norm_target_sz_h = params.target_sz(1) * params.norm_bg_area(1) / bg_area(1); params.norm_target_sz = round([norm_target_sz_h norm_target_sz_w]); % distance (on one side) between target and bg area norm_pad = floor((params.norm_bg_area - params.norm_target_sz) / 2); radius = min(norm_pad); % norm_delta_area is the number of rectangles that are considered. % it is the "sampling space" and the dimension of the final merged resposne % it is squared to not privilege any particular direction params.norm_delta_area = (2*radius+1) * [1, 1]; % Rectangle in which the integral images are computed. % Grid of rectangles ( each of size norm_target_sz) has size norm_delta_area. params.norm_pwp_search_area = params.norm_target_sz + params.norm_delta_area - 1; end
05-31

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值