Commit b8dbfb9f authored by 霍传世's avatar 霍传世

HaiNaAi测试小程序

parent e2a89fa2
......@@ -26,7 +26,7 @@ public class LoginController {
@PostMapping
public ResponseEntity LoginGo(@RequestBody ExamStudent examStudent){
if((examStudent.getZkzNum().equals("111")&&examStudent.getIdCard().equals("111"))||(examStudent.getZkzNum().equals("222")&&examStudent.getIdCard().equals("222"))||(examStudent.getZkzNum().equals("333")&&examStudent.getIdCard().equals("333"))){
if(examStudent.getZkzNum().equals("111")&&examStudent.getIdCard().equals("111")){
redisTemplate.opsForValue().set("51096606163",new JSONObject(examStudent).toString(),2*60*60, TimeUnit.SECONDS);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token","51096606163");
......@@ -34,6 +34,46 @@ public class LoginController {
jsonObject.put("message","登录成功");
return ResponseEntity.ok(jsonObject.toString());
}
if(examStudent.getZkzNum().equals("222")&&examStudent.getIdCard().equals("222")){
redisTemplate.opsForValue().set("51069292339",new JSONObject(examStudent).toString(),2*60*60, TimeUnit.SECONDS);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token","51069292339");
jsonObject.put("code",200);
jsonObject.put("message","登录成功");
return ResponseEntity.ok(jsonObject.toString());
}
if(examStudent.getZkzNum().equals("333")&&examStudent.getIdCard().equals("333")){
redisTemplate.opsForValue().set("51027367515",new JSONObject(examStudent).toString(),2*60*60, TimeUnit.SECONDS);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token","51027367515");
jsonObject.put("code",200);
jsonObject.put("message","登录成功");
return ResponseEntity.ok(jsonObject.toString());
}
if(examStudent.getZkzNum().equals("444")&&examStudent.getIdCard().equals("444")){
redisTemplate.opsForValue().set("51010817155",new JSONObject(examStudent).toString(),2*60*60, TimeUnit.SECONDS);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token","51010817155");
jsonObject.put("code",200);
jsonObject.put("message","登录成功");
return ResponseEntity.ok(jsonObject.toString());
}
if(examStudent.getZkzNum().equals("555")&&examStudent.getIdCard().equals("555")){
redisTemplate.opsForValue().set("51021560057",new JSONObject(examStudent).toString(),2*60*60, TimeUnit.SECONDS);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token","51021560057");
jsonObject.put("code",200);
jsonObject.put("message","登录成功");
return ResponseEntity.ok(jsonObject.toString());
}
if(examStudent.getZkzNum().equals("666")&&examStudent.getIdCard().equals("666")){
redisTemplate.opsForValue().set("51007580358",new JSONObject(examStudent).toString(),2*60*60, TimeUnit.SECONDS);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token","51007580358");
jsonObject.put("code",200);
jsonObject.put("message","登录成功");
return ResponseEntity.ok(jsonObject.toString());
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("code",500);
jsonObject.put("message","账号密码错误");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment