parent
10d02198a5
commit
79447032d0
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.tcZz.controller;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.tcZz.utils.SecretUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* 对接大屏登录接口
|
||||
*
|
||||
* @author wu
|
||||
* @since 2024/8/6 下午4:53
|
||||
*/
|
||||
@Api(tags = "对接大屏登录接口")
|
||||
@RestController
|
||||
@RequestMapping("/tcZz/networkEcology/singleLogin")
|
||||
public class SingleLoginController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param password 系统加密的密文
|
||||
* @return token
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
public static String getToken(String userName, String password) throws Exception {
|
||||
|
||||
return SecretUtil.jasyptSymmetry(userName + "#" + password + "#" + System.currentTimeMillis() / 1000, SecretUtil.HMAC_SHA1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 对接大屏登录接口1
|
||||
*
|
||||
* @return 响应类
|
||||
*/
|
||||
@ApiOperation(value = "对接大屏登录接口1")
|
||||
@GetMapping("/login1")
|
||||
public AjaxResult login1(String[] args) throws Exception {
|
||||
String token = getToken("admin", "59a984baa2991e4adcc4d307aa967b2516494386");
|
||||
String encodeToken = URLEncoder.encode(token, "UTF-8");
|
||||
String s = "https://2.35.38.240/api/v2/singleLogin?" + "token=" + encodeToken + "&url=https://2.35.38.240/dasv/preview/4mj2a4fjqccg";
|
||||
return AjaxResult.success((Object) s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对接大屏登录接口1
|
||||
*
|
||||
* @return 响应类
|
||||
*/
|
||||
@ApiOperation(value = "对接大屏登录接口2")
|
||||
@GetMapping("/login2")
|
||||
public AjaxResult login2(String[] args) throws Exception {
|
||||
String token = getToken("admin", "59a984baa2991e4adcc4d307aa967b2516494386");
|
||||
String encodeToken = URLEncoder.encode(token, "UTF-8");
|
||||
String s = "https://2.35.38.240/api/v2/singleLogin?" + "token=" + encodeToken + "&url=https://2.35.38.240/dasv/preview/4mj2bpr9ccn4";
|
||||
return AjaxResult.success((Object) s);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue