java实现猜你喜欢功能_计算机毕业设计中用Java实现登录功能

f1319ec8ec4c5cfdc7a6ae7b3406f30f.png点击上方“蓝字”,关注我们.

package com.fh.controller.wxlogin;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLConnection;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Security;
import java.security.spec.InvalidParameterSpecException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fh.controller.base.BaseController;
import com.fh.controller.common.Base64Util;
import com.fh.controller.common.HttpRequest;
import com.fh.entity.system.WxUser;
import com.fh.service.wxlogin.WxuserService;
import com.fh.util.AppUtil;
import com.fh.util.Const;
import com.fh.util.DateUtil;
import com.fh.util.PageData;
import com.fh.util.wxPayUtils.WxPayConfig;

import net.sf.json.JSONObject;

@Controller
@RequestMapping(value="/wxuser")
public class WxLogin extends BaseController{

@Resource(name="wxuserService")
private WxuserService wxuserService;


@RequestMapping(value="/login",method = RequestMethod.POST)
@ResponseBody
public Object doLogin(Model model,
@RequestParam(value = "code",required = false) String code,
@RequestParam(value = "user_info",required = false) String rawData,
@RequestParam(value = "encrypted_data",required = false) String encrypteData,
@RequestParam(value = "iv",required = false) String iv,
@RequestParam(value = "signature",required = false) String signature
) {
System.out.println("进入");
Map map = new HashMap();
if(code.equals("")||code==null) {
map.put("errmsg","code为空!");
return map;
}if(rawData.equals("")||rawData==null) {
map.put("errmsg","rawData为空!");
return map;
}
if(encrypteData.equals("")||encrypteData==null) {
map.put("errmsg","encrypteData为空!");
return map;
}
if(iv.equals("")||iv==null) {
map.put("errmsg","iv为空!");
return map;
}
if(signature.equals("")||signature==null) {
map.put("errmsg","signature为空!");
return map;
}
/*
* JsonOb
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值