删除了一些暂时不用的代码和配置,重构了部分方法和实现
This commit is contained in:
parent
fe2a9612c1
commit
ce34857d8a
@ -6,4 +6,6 @@ package com.zayac.changeurl.common;
|
|||||||
*/
|
*/
|
||||||
public class Constant {
|
public class Constant {
|
||||||
public static final String URL_PATTERN = "(https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6})(:[0-9]{1,5})?";
|
public static final String URL_PATTERN = "(https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6})(:[0-9]{1,5})?";
|
||||||
|
|
||||||
|
public static final String PREFER = "新";
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.zayac.changeurl.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zayac
|
||||||
|
* @since 2023-09-09 10:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class HthTemplateEntity {
|
||||||
|
private String app1;
|
||||||
|
private String app2;
|
||||||
|
private String pc;
|
||||||
|
private String h5;
|
||||||
|
private String templatePath;
|
||||||
|
private List<String> targets;
|
||||||
|
|
||||||
|
public String getApp1() {
|
||||||
|
return convert(app1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApp2() {
|
||||||
|
return convert(app2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPc() {
|
||||||
|
return convert(pc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getH5() {
|
||||||
|
return convert(h5);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String convert(String text) {
|
||||||
|
return "{{" + text + "}}";
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,6 @@ import com.zayac.changeurl.annotation.MsgAnnotation;
|
|||||||
import com.zayac.changeurl.common.Constant;
|
import com.zayac.changeurl.common.Constant;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.sound.midi.Soundbank;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -20,7 +19,6 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class KyMsgEntity {
|
public class KyMsgEntity {
|
||||||
private final String PREFER = "新";
|
|
||||||
@MsgAnnotation(startWith = "WEB")
|
@MsgAnnotation(startWith = "WEB")
|
||||||
private List<String> pc;
|
private List<String> pc;
|
||||||
@MsgAnnotation(startWith = "H5")
|
@MsgAnnotation(startWith = "H5")
|
||||||
@ -48,18 +46,22 @@ public class KyMsgEntity {
|
|||||||
for (String s : array) {
|
for (String s : array) {
|
||||||
if (s.startsWith(startWith)) {
|
if (s.startsWith(startWith)) {
|
||||||
// 如果找到匹配的字符串,添加到列表中
|
// 如果找到匹配的字符串,添加到列表中
|
||||||
matched.add(ReUtil.getGroup1(Constant.URL_PATTERN, s));
|
matched.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//断言 list中不含有null值,防止修改数据为空
|
|
||||||
Assert.noNullElements(ArrayUtil.toArray(matched, String.class));
|
|
||||||
// 设置字段的访问权限为true,以便赋值操作
|
// 设置字段的访问权限为true,以便赋值操作
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
// 判断字段的类型是否是List
|
// 判断字段的类型是否是List 如果是List类型,直接将匹配的列表赋值给该字段
|
||||||
if (field.getType().isAssignableFrom(List.class)) {
|
if (field.getType().isAssignableFrom(List.class)) {
|
||||||
// 如果是List类型,直接将匹配的列表赋值给该字段
|
//优先将包含新字的放到List第一位置
|
||||||
matched = matched.stream().sorted(Comparator.comparing(str -> str.contains(PREFER))).collect(Collectors.toList());
|
matched = matched.stream()
|
||||||
|
.sorted(Comparator.comparing(str -> !str.contains(Constant.PREFER)))
|
||||||
|
.map(x -> ReUtil.getGroup1(Constant.URL_PATTERN, x))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//断言 list中不含有null值,防止修改数据为空
|
||||||
|
Assert.noNullElements(ArrayUtil.toArray(matched, String.class));
|
||||||
field.set(this, matched);
|
field.set(this, matched);
|
||||||
} else {
|
} else {
|
||||||
// 如果不是List类型,判断匹配的列表是否为空
|
// 如果不是List类型,判断匹配的列表是否为空
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.zayac.changeurl.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zayac
|
||||||
|
* @since 2023-09-09 10:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class KyTemplateEntity {
|
||||||
|
private String app1;
|
||||||
|
private String app2;
|
||||||
|
private String pc1;
|
||||||
|
private String pc2;
|
||||||
|
private String h51;
|
||||||
|
private String h52;
|
||||||
|
private String templatePath;
|
||||||
|
private List<String> targets;
|
||||||
|
|
||||||
|
public String getApp1() {
|
||||||
|
return convert(app1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApp2() {
|
||||||
|
return convert(app2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPc1() {
|
||||||
|
return convert(pc1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPc2() {
|
||||||
|
return convert(pc2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getH51() {
|
||||||
|
return convert(h51);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getH52() {
|
||||||
|
return convert(h52);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String convert(String text) {
|
||||||
|
return "{{" + text + "}}";
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +0,0 @@
|
|||||||
package com.zayac.changeurl.entity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zayac
|
|
||||||
* @since 2023-08-30 15:19
|
|
||||||
*/
|
|
||||||
public record Msg2JSEntity(String original, String target) { }
|
|
@ -3,14 +3,13 @@ package com.zayac.changeurl.service;
|
|||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.system.SystemUtil;
|
import com.zayac.changeurl.common.Constant;
|
||||||
import com.zayac.changeurl.entity.Msg2JSEntity;
|
import com.zayac.changeurl.entity.*;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zayac
|
* @author zayac
|
||||||
@ -18,99 +17,68 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ChangeURLServiceImpl implements ChangeURLService {
|
public class ChangeURLServiceImpl implements ChangeURLService {
|
||||||
|
private static final String KYJS = "ky.js";
|
||||||
public static final String URL_PATTERN = "(https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6})(:[0-9]{1,5})?";
|
private static final String HTHJS = "hth.js";
|
||||||
private static final String PREFER = "新";
|
|
||||||
@Value("${js.path.targets}")
|
|
||||||
//开云唯一词
|
|
||||||
private String[] targets;
|
|
||||||
|
|
||||||
@Value("${js.path.template}")
|
|
||||||
//开云唯一词
|
|
||||||
private String templatePath;
|
|
||||||
|
|
||||||
@Value("${msg.ky.startWith.web}")
|
|
||||||
private String msgKyWeb;
|
|
||||||
|
|
||||||
@Value("${msg.ky.startWith.h5}")
|
|
||||||
private String msgKyH5;
|
|
||||||
|
|
||||||
@Value("${msg.ky.startWith.app}")
|
|
||||||
private String msgKyApp;
|
|
||||||
|
|
||||||
|
|
||||||
@Value("${msg.hth.startWith.web}")
|
|
||||||
private String msgHthWeb;
|
|
||||||
@Value("${msg.hth.startWith.h5}")
|
|
||||||
private String msgHthH5;
|
|
||||||
|
|
||||||
@Value("${msg.hth.startWith.app1}")
|
|
||||||
private String msgHthApp1;
|
|
||||||
|
|
||||||
@Value("${msg.hth.startWith.app2}")
|
|
||||||
private String msgHthApp2;
|
|
||||||
|
|
||||||
//js修改部分
|
|
||||||
@Value("${js.ky.kyweb1}")
|
|
||||||
private String jsKyWeb1;
|
|
||||||
|
|
||||||
@Value("${js.ky.kyweb2}")
|
|
||||||
private String jsKyWeb2;
|
|
||||||
|
|
||||||
@Value("${js.ky.kyh51}")
|
|
||||||
private String jsKyH51;
|
|
||||||
|
|
||||||
@Value("${js.ky.kyh52}")
|
|
||||||
private String jsKyH52;
|
|
||||||
|
|
||||||
@Value("${js.ky.kyApp1}")
|
|
||||||
private String jsKyApp1;
|
|
||||||
|
|
||||||
@Value("${js.ky.kyApp2}")
|
|
||||||
private String jsKyApp2;
|
|
||||||
|
|
||||||
@Value("${js.hth.hthweb}")
|
|
||||||
private String jsHthWeb;
|
|
||||||
|
|
||||||
@Value("${js.hth.hthh5}")
|
|
||||||
private String jsHthH5;
|
|
||||||
|
|
||||||
@Value("${js.hth.hthApp1}")
|
|
||||||
private String jsHthApp1;
|
|
||||||
|
|
||||||
@Value("${js.hth.hthApp2}")
|
|
||||||
private String jsHthApp2;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean change(String text) {
|
public Boolean change(String text) {
|
||||||
//如果传入参数为空,返回修改失败
|
//如果传入参数为空,返回修改失败
|
||||||
if (StrUtil.isEmpty(text)) {
|
if (StrUtil.isEmpty(text)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
String[] arr = text.split("\n");
|
||||||
|
|
||||||
|
//传入text 包含SEO 专用域名 则为开云
|
||||||
|
if (text.contains("SEO 专用域名")) {
|
||||||
|
KyMsgEntity kyMsg = new KyMsgEntity(arr);
|
||||||
|
List<String> kyTargets = new ArrayList<>();
|
||||||
|
kyTargets.add(KYJS);
|
||||||
|
|
||||||
|
KyTemplateEntity kyTemplate =
|
||||||
|
new KyTemplateEntity(
|
||||||
|
"kyApp1",
|
||||||
|
"kyApp2",
|
||||||
|
"kyPc1",
|
||||||
|
"kyPc2",
|
||||||
|
"kyH51",
|
||||||
|
"kyH52",
|
||||||
|
"ky.js.template",
|
||||||
|
kyTargets);
|
||||||
|
//读取模板文件
|
||||||
|
String template = loadTemplate(kyTemplate.getTemplatePath());
|
||||||
|
template = template
|
||||||
|
.replace(kyTemplate.getApp1(), kyMsg.getApp().get(0))
|
||||||
|
.replace(kyTemplate.getApp2(), kyMsg.getApp().get(1))
|
||||||
|
.replace(kyTemplate.getH51(), kyMsg.getH5().get(0))
|
||||||
|
.replace(kyTemplate.getH52(), kyMsg.getH5().get(1))
|
||||||
|
.replace(kyTemplate.getPc1(), kyMsg.getPc().get(0))
|
||||||
|
.replace(kyTemplate.getPc2(), kyMsg.getPc().get(1));
|
||||||
|
|
||||||
|
modifyFile(template, kyTemplate.getTargets());
|
||||||
|
//读取修改过的文件 校验修改成功失败
|
||||||
|
String result = FileUtil.readUtf8String(KYJS);
|
||||||
|
//如果修改后的js文件中,
|
||||||
|
return ReUtil.count(Constant.URL_PATTERN, result) >= 6;
|
||||||
} else {
|
} else {
|
||||||
text = StrUtil.subBefore(text, "SEO防拦截域名", false);
|
HthMsgEntity hthMsg = new HthMsgEntity(arr);
|
||||||
|
List<String> hthTargets = new ArrayList<>();
|
||||||
|
hthTargets.add(HTHJS);
|
||||||
|
HthTemplateEntity hthTemplate = new HthTemplateEntity("hthApp", "hthtyApp", "hthPc", "hthH5", "hth.js.template", hthTargets);
|
||||||
|
//读取模板文件
|
||||||
|
String template = loadTemplate(hthTemplate.getTemplatePath());
|
||||||
|
template = template
|
||||||
|
.replace(hthTemplate.getApp1(), hthMsg.getApp())
|
||||||
|
.replace(hthTemplate.getApp2(), hthMsg.getTyApp())
|
||||||
|
.replace(hthTemplate.getPc(), hthMsg.getPc())
|
||||||
|
.replace(hthTemplate.getH5(), hthMsg.getH5());
|
||||||
|
modifyFile(template, hthTemplate.getTargets());
|
||||||
|
//读取修改过的文件 校验修改成功失败
|
||||||
|
String result = FileUtil.readUtf8String(HTHJS);
|
||||||
|
//如果修改后的js文件中,
|
||||||
|
return ReUtil.count(Constant.URL_PATTERN, result) >= 4;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理传入参数
|
|
||||||
String[] strings = StrUtil.splitToArray(text, SystemUtil.LINE_SEPARATOR);
|
|
||||||
|
|
||||||
List<String> msgKyWebList = getByStartWith(strings, msgKyWeb, URL_PATTERN, PREFER);
|
|
||||||
List<String> msgKyH5List = getByStartWith(strings, msgKyH5, URL_PATTERN, PREFER);
|
|
||||||
List<String> msgKyAppList = getByStartWith(strings, msgKyApp, URL_PATTERN, PREFER);
|
|
||||||
String template = loadTemplate(templatePath);
|
|
||||||
List<Msg2JSEntity> listEntity = toListEntity(msgKyWebList, msgKyH5List, msgKyAppList);
|
|
||||||
for (Msg2JSEntity msg2JSEntity : listEntity) {
|
|
||||||
template = template.replace(msg2JSEntity.original(), msg2JSEntity.target());
|
|
||||||
}
|
|
||||||
for (String target : targets) {
|
|
||||||
if (FileUtil.exist(target)) {
|
|
||||||
FileUtil.del(target);
|
|
||||||
} else {
|
|
||||||
FileUtil.newFile(target);
|
|
||||||
}
|
|
||||||
FileUtil.writeString(template, target, "UTF-8");
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,45 +96,14 @@ public class ChangeURLServiceImpl implements ChangeURLService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void modifyFile(String text, List<String> paths) {
|
||||||
* 处理传入飞机信息
|
for (String target : paths) {
|
||||||
*
|
if (FileUtil.exist(target)) {
|
||||||
* @param arr 字符数组
|
FileUtil.del(target);
|
||||||
* @param startWith 开始标识
|
} else {
|
||||||
* @param pattern url正则字符
|
FileUtil.newFile(target);
|
||||||
* @param prefer 优先
|
}
|
||||||
* @return List
|
FileUtil.writeString(text, target, "UTF-8");
|
||||||
*/
|
|
||||||
public List<String> getByStartWith(String[] arr, String startWith, String pattern, String prefer) {
|
|
||||||
List<String> list = Arrays.stream(arr)
|
|
||||||
.filter(item -> item.startsWith(startWith))
|
|
||||||
.map(x -> ReUtil.getGroup1(pattern, x))
|
|
||||||
.sorted(Comparator.comparing(str -> str.contains(prefer)))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
if (list.size() == 0) {
|
|
||||||
throw new RuntimeException("飞机信息处理错误");
|
|
||||||
}
|
}
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Msg2JSEntity> toListEntity(List<String> msgKyWebList,
|
|
||||||
List<String> msgKyH5List,
|
|
||||||
List<String> msgKyAppList) {
|
|
||||||
ArrayList<Msg2JSEntity> msg2JSEntities = new ArrayList<>();
|
|
||||||
msg2JSEntities.add(build(jsKyWeb1, msgKyWebList.get(0)));
|
|
||||||
msg2JSEntities.add(build(jsKyWeb2, msgKyWebList.get(1)));
|
|
||||||
msg2JSEntities.add(build(jsKyH51, msgKyH5List.get(0)));
|
|
||||||
msg2JSEntities.add(build(jsKyH52, msgKyH5List.get(1)));
|
|
||||||
msg2JSEntities.add(build(jsKyApp1, msgKyAppList.get(0)));
|
|
||||||
msg2JSEntities.add(build(jsKyApp2, msgKyAppList.get(1)));
|
|
||||||
return msg2JSEntities.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Msg2JSEntity build(String js, String msg) {
|
|
||||||
if (StrUtil.isNotEmpty(js) && StrUtil.isNotEmpty(msg)) {
|
|
||||||
return new Msg2JSEntity("{{" + js + "}}", msg);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
package com.zayac.changeurl.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zayac
|
|
||||||
* @since 2023-09-08 23:00
|
|
||||||
*/
|
|
||||||
public class KyMsgStrategy implements MsgStrategy{
|
|
||||||
@Override
|
|
||||||
public Object transform() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
package com.zayac.changeurl.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义一个飞机信息转化的接口
|
|
||||||
*
|
|
||||||
* @author zayac
|
|
||||||
* @since 2023-09-08 22:57
|
|
||||||
*/
|
|
||||||
public interface MsgStrategy<T> {
|
|
||||||
public T transform();
|
|
||||||
}
|
|
@ -1,32 +1,3 @@
|
|||||||
msg:
|
|
||||||
ky:
|
|
||||||
startWith:
|
|
||||||
web: "WEB"
|
|
||||||
h5: "H5"
|
|
||||||
app: "全站"
|
|
||||||
hth:
|
|
||||||
startWith:
|
|
||||||
web: ""
|
|
||||||
h5: ""
|
|
||||||
app1: ""
|
|
||||||
app2: ""
|
|
||||||
js:
|
|
||||||
ky:
|
|
||||||
kyweb1: "kyPc"
|
|
||||||
kyweb2: ""
|
|
||||||
kyh51: "kyH5"
|
|
||||||
kyh52: ""
|
|
||||||
kyApp1: "kyApp"
|
|
||||||
kyApp2: ""
|
|
||||||
hth:
|
|
||||||
hthweb: ""
|
|
||||||
hthh5: ""
|
|
||||||
hthApp1: ""
|
|
||||||
hthApp2: ""
|
|
||||||
path:
|
|
||||||
template: "link.js.template"
|
|
||||||
targets: "link.js"
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8888
|
port: 8888
|
||||||
spring:
|
spring:
|
||||||
@ -35,4 +6,4 @@ spring:
|
|||||||
caffeine:
|
caffeine:
|
||||||
spec: maximumSize=100,expireAfterWrite=10m
|
spec: maximumSize=100,expireAfterWrite=10m
|
||||||
ip:
|
ip:
|
||||||
white: "127.0.0.1"
|
white: "0.0.0.0"
|
@ -1,33 +1,3 @@
|
|||||||
|
|
||||||
msg:
|
|
||||||
ky:
|
|
||||||
startWith:
|
|
||||||
web: "WEB"
|
|
||||||
h5: "H5"
|
|
||||||
app: "全站"
|
|
||||||
hth:
|
|
||||||
startWith:
|
|
||||||
web: "web"
|
|
||||||
h5: "h5"
|
|
||||||
app1: "全站APP"
|
|
||||||
app2: "体育APP"
|
|
||||||
js:
|
|
||||||
ky:
|
|
||||||
kyweb1: "kyweb1"
|
|
||||||
kyweb2: "kyweb2"
|
|
||||||
kyh51: "kyh51"
|
|
||||||
kyh52: "kyh52"
|
|
||||||
kyApp1: "kyApp"
|
|
||||||
kyApp2: "kyApp2"
|
|
||||||
hth:
|
|
||||||
hthweb: "hthweb"
|
|
||||||
hthh5: "hthh5"
|
|
||||||
hthApp1: "hthApp1"
|
|
||||||
hthApp2: "hthApp2"
|
|
||||||
path:
|
|
||||||
template: "link.js.template"
|
|
||||||
targets: "link.js"
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8888
|
port: 8888
|
||||||
spring:
|
spring:
|
||||||
@ -36,4 +6,4 @@ spring:
|
|||||||
caffeine:
|
caffeine:
|
||||||
spec: maximumSize=100,expireAfterWrite=10m
|
spec: maximumSize=100,expireAfterWrite=10m
|
||||||
profiles:
|
profiles:
|
||||||
active: ky
|
active: "ky"
|
12
src/main/resources/hth.js.template
Normal file
12
src/main/resources/hth.js.template
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
const hthCode = '3016341',
|
||||||
|
|
||||||
|
var hth_link = {
|
||||||
|
hthApp: '{{hthApp}}/?i_code='+hthCode,
|
||||||
|
hthtyApp: '{{hthtyApp}}/?i_code='+hthCode,
|
||||||
|
hthPc: '{{hthPc}}/register/?i_code='+hthCode,
|
||||||
|
hthH5: '{{hthH5}}/entry/register?i_code='+hthCode,
|
||||||
|
}
|
||||||
|
|
||||||
|
function visit_hth(key) {
|
||||||
|
window['open'](hth_link[key] )
|
||||||
|
}
|
15
src/main/resources/ky.js.template
Normal file
15
src/main/resources/ky.js.template
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
const hthCode = '3016341',
|
||||||
|
kyCode = '97238304'
|
||||||
|
|
||||||
|
var ky_link = {
|
||||||
|
kyApp1: '{{kyApp1}}/?i_code='+kyCode,
|
||||||
|
kyApp2: '{{kyApp2}}/?i_code='+kyCode,
|
||||||
|
kyPc1: '{{kyPc1}}/register/?i_code='+kyCode,
|
||||||
|
kyPc2: '{{kyPc2}}/register?i_code='+kyCode,
|
||||||
|
kyH51: '{{kyH51}}/entry/register?i_code='+kyCode,
|
||||||
|
kyH52: '{{kyH52}}/entry/register?i_code='+kyCode
|
||||||
|
}
|
||||||
|
|
||||||
|
function visit_ky(key) {
|
||||||
|
window['open'](ky_link[key] )
|
||||||
|
}
|
@ -1,38 +0,0 @@
|
|||||||
let code = '97238304',
|
|
||||||
ybty_link = {
|
|
||||||
kyApp: '{{kyApp}}/?i_code=' + code,// 开云全站app
|
|
||||||
kyPc: '{{kyPc}}/register/?i_code=' + code,//·开云体育电脑端
|
|
||||||
kyH5: '{{kyH5}}/entry/register/?i_code=' + code,//·开云体育手机端
|
|
||||||
}
|
|
||||||
|
|
||||||
function ybty_visit(key) {
|
|
||||||
window.location.href = ybty_link[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
function ybty_visit_newopen(key) {
|
|
||||||
window.open(ybty_link[key])
|
|
||||||
}
|
|
||||||
|
|
||||||
function ybty_kf(url) {
|
|
||||||
window.open(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMyUrl(key) {
|
|
||||||
return ybty_link[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
function deviceYBRegister(code) {
|
|
||||||
if (window.innerWidth < 768) {
|
|
||||||
window.open(ybty_link['ybH5']);
|
|
||||||
} else {
|
|
||||||
window.open(ybty_link['ybPc']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deviceLYRegister(code) {
|
|
||||||
if (window.innerWidth < 768) {
|
|
||||||
window.open(ybty_link['ybH55']);
|
|
||||||
} else {
|
|
||||||
window.open(ybty_link['ybPc']);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user