MCPcopy Create free account
hub / github.com/diyhi/bbs / createVideoRedirectLink

Method createVideoRedirectLink

src/main/java/cms/utils/SecureLink.java:72–85  ·  view source on GitHub ↗

生成视频重定向链接 @param link 链接 @param tagId 标签Id -1表示管理后台打开链接,不校验权限 @param secret 密钥 16位字符 @return

(String link,Long tagId,String secret)

Source from the content-addressed store, hash-verified

70 * @return
71 */
72 public static String createVideoRedirectLink(String link,Long tagId,String secret){
73 JsonComponent jsonComponent = (JsonComponent)SpringConfigTool.getContext().getBean("jsonComponent");
74 Map<String,String> parameterMap = new HashMap<String,String>();
75 parameterMap.put("link", link);
76 parameterMap.put("tagId", String.valueOf(tagId));
77 String parameter_json = jsonComponent.toJSONString(parameterMap);
78
79 String ciphertext = AES.encrypt(parameter_json, secret, null);
80
81
82 return UriComponentsBuilder.fromUriString("videoRedirect")
83 .queryParam("jump", Base64.encodeBase64URL(ciphertext))
84 .build().toString();
85 }
86
87 /**
88 * 生成安全链接

Callers 2

processVideoPlayerMethod · 0.95
processVideoInfoMethod · 0.95

Calls 6

getContextMethod · 0.95
toJSONStringMethod · 0.95
encryptMethod · 0.95
encodeBase64URLMethod · 0.95
putMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected