Просмотр исходного кода

wip:前置代理增加反爬虫

wangkaiyue 2 лет назад
Родитель
Сommit
f9384ca618

+ 1 - 0
common/gatecode/errcode.go

@@ -38,6 +38,7 @@ const (
 	GATEWAY_PROXY_ERR                                    // 服务异常
 	GATEWAY_RPC_USERCENTER_ERR                           // 用户中心服务异常
 	GATEWAY_RPC_RESOURCECENTER_ERR                       // 资源中心服务异常
+	GATEWAY_HTML_RENDER_ERR                              // 页面渲染异常
 )
 const (
 	// SERVER_ERR_NIL 服务接口错误定义

+ 0 - 77
common/gatecode/errcode_string.go

@@ -1,77 +0,0 @@
-// Code generated by "stringer -type ErrCode -linecomment"; DO NOT EDIT.
-
-package gatecode
-
-import "strconv"
-
-func _() {
-	// An "invalid array index" compiler error signifies that the constant values have changed.
-	// Re-run the stringer command to generate them again.
-	var x [1]struct{}
-	_ = x[GLOBAL_ERR_NIL-1000]
-	_ = x[GLOBAL_ERR_NOTLOGIN-1001]
-	_ = x[GLOBAL_ERR_NOENT_SELECT-1002]
-	_ = x[GLOBAL_ERR_NOPOWER-1003]
-	_ = x[GLOBAL_ERR_UNFINISH-1004]
-	_ = x[GLOBAL_ERR_ENTACCOUNT_STATUS-1005]
-	_ = x[GLOBAL_ERR_ENTACCOUNT_AUTH_NOT-1006]
-	_ = x[GLOBAL_ERR_ENTACCOUNT_AUTH_AWAIT-1007]
-	_ = x[GLOBAL_ERR_ENTACCOUNT_AUTH_NOTPASS-1008]
-	_ = x[GLOBAL_ERR_ENTACCOUNT_AUTH_EXPIRED-1009]
-	_ = x[GLOBAL_ERR_RESOURCE_POWERCODE_ERR-1010]
-	_ = x[GLOBAL_ERR_RESOURCE_PORWE_FAIL-1011]
-	_ = x[GLOBAL_ERR_RESOURCE_PORWE_EXPIRED-1012]
-	_ = x[GLOBAL_ERR_RESOURCE_PORWE_NOTENOUGH-1013]
-	_ = x[GLOBAL_ERR_RESOURCE_PORWE_NOTHAS-1014]
-	_ = x[GLOBAL_ERR_RESOURCE_PORWE_RECHARGE-1015]
-	_ = x[GLOBAL_ERR_RESOURCE_PORWE_RECHARGE_FULL-1016]
-	_ = x[GLOBAL_ERR_CONFIG_FAIL-1017]
-	_ = x[GATEWAY_ERR_NIL-2000]
-	_ = x[GATEWAY_MODULE_UNDEFINED-2001]
-	_ = x[GATEWAY_MODULE_SERVER_ERR-2002]
-	_ = x[GATEWAY_ROUTER_NOTFIND-2003]
-	_ = x[GATEWAY_ROUTER_UPHOLD-2004]
-	_ = x[GATEWAY_REGISTED_URL_ERR-2005]
-	_ = x[GATEWAY_PROXY_ERR-2006]
-	_ = x[GATEWAY_RPC_USERCENTER_ERR-2007]
-	_ = x[GATEWAY_RPC_RESOURCECENTER_ERR-2008]
-	_ = x[SERVER_ERR_NIL-3000]
-	_ = x[SERVER_DETAIL_TIMEOUT-3001]
-	_ = x[SERVER_DEDUCT_PARAM_LACK-3002]
-	_ = x[OTHER_ERR_NIL-4000]
-	_ = x[OTHER_ERR_UNDEFINED-4001]
-	_ = x[OTHER_ERR_OFTEN-4002]
-}
-
-const (
-	_ErrCode_name_0 = "global OK无用户身份无选择企业没有权限正在开发中企业账户已被冻结企业未认证企业认证待审核企业认证未通过企业认证已过期无效资源code权限校验失败权益已过期权益余额不足没有权限资源充值异常资源充值已达上限配置异常"
-	_ErrCode_name_1 = "gateway ok未知节点节点无可用服务未注册路由地址接口维护中服务地址异常服务异常用户中心服务异常资源中心服务异常"
-	_ErrCode_name_2 = "server ok接口超时扣减异常"
-	_ErrCode_name_3 = "server ok未知异常请求频繁"
-)
-
-var (
-	_ErrCode_index_0 = [...]uint16{0, 9, 24, 39, 51, 66, 90, 105, 126, 147, 168, 184, 202, 217, 235, 247, 265, 289, 301}
-	_ErrCode_index_1 = [...]uint8{0, 10, 22, 43, 64, 79, 97, 109, 133, 157}
-	_ErrCode_index_2 = [...]uint8{0, 9, 21, 33}
-	_ErrCode_index_3 = [...]uint8{0, 9, 21, 33}
-)
-
-func (i ErrCode) String() string {
-	switch {
-	case 1000 <= i && i <= 1017:
-		i -= 1000
-		return _ErrCode_name_0[_ErrCode_index_0[i]:_ErrCode_index_0[i+1]]
-	case 2000 <= i && i <= 2008:
-		i -= 2000
-		return _ErrCode_name_1[_ErrCode_index_1[i]:_ErrCode_index_1[i+1]]
-	case 3000 <= i && i <= 3002:
-		i -= 3000
-		return _ErrCode_name_2[_ErrCode_index_2[i]:_ErrCode_index_2[i+1]]
-	case 4000 <= i && i <= 4002:
-		i -= 4000
-		return _ErrCode_name_3[_ErrCode_index_3[i]:_ErrCode_index_3[i+1]]
-	default:
-		return "ErrCode(" + strconv.FormatInt(int64(i), 10) + ")"
-	}
-}

+ 19 - 0
common/httpUtil/util.go

@@ -0,0 +1,19 @@
+package httpUtil
+
+import (
+	"html/template"
+	"net/http"
+)
+
+//Render 渲染html 返回渲染后的html
+func Render(w http.ResponseWriter, tmp string, data *map[string]interface{}) error {
+	t, err := template.ParseFiles(tmp)
+	if err != nil {
+		return err
+	}
+	err = t.Execute(w, data)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 1 - 0
core/proxy/filterPoly/reqRule.go

@@ -19,4 +19,5 @@ type ReqRule struct {
 	IpMaxBlockTimes []int64   `json:"ipMaxBlockTimes"` //最大临时黑名单次数,进永久黑名单
 	VcodeErrorTimes []int64   `json:"vcodeErrorTimes"` //验证码错误次数,进临时黑名单
 	TempBlockTime   int64     `json:"tempBlockTime"`   //临时黑名单时间
+	VerifyPage      string    `json:"verifyPage"`      //验证码校验页面
 }

+ 30 - 1
core/proxy/middleware/spiderPolyHandler.go

@@ -2,10 +2,17 @@ package middleware
 
 import (
 	. "bp.jydev.jianyu360.cn/BaseService/gateway/common/gatecode"
+	"bp.jydev.jianyu360.cn/BaseService/gateway/common/httpUtil"
 	"bp.jydev.jianyu360.cn/BaseService/gateway/core/proxy/filterPoly"
 	"bp.jydev.jianyu360.cn/BaseService/gateway/core/router"
 	"fmt"
 	"github.com/gogf/gf/v2/net/ghttp"
+	"strings"
+)
+
+const (
+	defaultVerifyPageHtml = "default"
+	VerifyPageHtmlSource  = "./resources/antiRes/page/%s.html"
 )
 
 var filterPolyManager *filterPoly.Manager
@@ -26,6 +33,10 @@ func FilterPolyHandler(r *ghttp.Request) {
 			return poly.IpFilter(ctx, r.GetClientIp())
 		}
 	}()
+	returnHtml := false
+	if strings.Contains(strings.ToLower(r.Header.Get("Accept")), "html") {
+		returnHtml = true
+	}
 	//是否开启黑名单
 	if status == -1 { //黑名单 不响应
 		r.SetError(NewErrorWithCode(OTHER_ERR_OFTEN, fmt.Sprintf("请求频繁限制")))
@@ -34,8 +45,26 @@ func FilterPolyHandler(r *ghttp.Request) {
 	}
 	if status == 2 { //处理验证码逻辑
 		rData := poly.VerifyHandle(r.Request, key)
-		r.Response.WriteJsonExit(rData)
+		if !returnHtml {
+			r.Response.WriteJsonExit(rData)
+		} else {
+			if renderErr := httpUtil.Render(r.Response.ResponseWriter, getVerifyPage(poly.Rule.VerifyPage), &rData); renderErr != nil {
+				r.SetError(NewErrorWithCode(GATEWAY_HTML_RENDER_ERR, fmt.Sprintf("验证码页面:%v\n", renderErr)))
+			}
+		}
 		return
 	}
 	r.Middleware.Next()
 }
+
+//getVerifyPage 获取验证码页面路径
+func getVerifyPage(page string) string {
+	if page != "" {
+		if strings.HasSuffix(page, ".html") {
+			page = strings.ReplaceAll(page, ".html", "")
+		}
+		return fmt.Sprintf(VerifyPageHtmlSource, page)
+	} else {
+		return fmt.Sprintf(VerifyPageHtmlSource, defaultVerifyPageHtml)
+	}
+}

+ 3 - 2
core/proxy/proxyServer.go

@@ -58,8 +58,9 @@ func InitGateWayServer() *ghttp.Server {
 	//加载代理客户端
 	proxyClient.ReLoadClient()
 	//注册代理
-	gateWayServer.BindHandler("POST:/*", proxyHandler)
-	gateWayServer.BindHandler("GET:/*", proxyHandler)
+	gateWayServer.BindHandler("POST:/*", proxyHandler)             //接口代理
+	gateWayServer.BindHandler("GET:/*", proxyHandler)              //页面代理
+	gateWayServer.AddStaticPath("/antiRes", "./resources/antiRes") //静态资源
 	return gateWayServer
 }
 

+ 506 - 0
resources/antiRes/css/app.css

@@ -0,0 +1,506 @@
+/*@import url(/jyapp/css/layout.css?v=51430);*/
+/*@import url(/jyapp/css/font.css?v=51430);*/
+body{
+	margin: 0px;
+	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
+	-webkit-tap-highlight-color: transparent;
+	font-size: 16px;
+}
+ul{
+	list-style: none;
+	padding: 0px;
+	margin: 0px;
+}
+img{
+	vertical-align: sub;
+}
+a{
+	color: #0987ff;
+}
+::-webkit-input-placeholder {
+    color: #ddd;
+}
+.overflow-hidden{
+	overflow: hidden;
+	height: 100%;
+}
+[type='text']{
+	border: 1px solid #ccc;
+	border-radius: 4px;
+	padding-left: 10px;
+	padding-right: 0px;
+}
+[type='text'],textarea{
+	box-shadow: 0px 0px 0px rgba(0,0,0,0);
+    -webkit-appearance: none;
+}
+.red-border{
+	border-color: red !important;
+}
+.btn{
+	background-color: #24C0D7;
+	text-align: center;
+	vertical-align: middle;
+	touch-action: manipulation;
+	cursor: pointer;
+	background-image: none;
+	border: 1px solid transparent;
+	white-space: nowrap;
+	padding: 8px 12px;
+	font-size: 14px;
+	line-height: 1.42857143;
+	border-radius: 4px;
+	-webkit-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+	color: #FFFFFF;
+	position: relative;
+	outline-width: 0px;
+	box-shadow: none !important;
+}
+.btn[disabled]{
+	cursor: not-allowed;
+	pointer-events: none;
+	opacity: .5;
+	filter: alpha(opacity=65);
+	-webkit-box-shadow: none;
+	box-shadow: none;
+}
+.border-top{
+	border-top: 1px solid #CCCCCC;
+}
+.hide{
+	display: none;
+}
+.mustshare-mark{
+	position: fixed;
+	left: 0px;
+	right: 0px;
+	bottom: 0px;
+	top: 0px;
+	background-color: rgba(0,0,0,.84);
+	z-index: 999999;
+	display: none;
+}
+.mustshare-mark img:nth-child(1){
+	position: absolute;
+	top: 140px;
+	left: 50%;
+	margin-left: -141px;
+	width: 282px;
+}
+.mustshare-mark img:nth-child(2){
+	position: absolute;
+	top: 350px;
+	left: 50%;
+	margin-left: -74px;
+	width: 148px;
+}
+
+.error-body {
+	width: 100%;
+	margin: 0;
+	padding: 0;
+	text-align: center;
+}
+
+.verify-body {
+	width: 90vw;
+	margin: 0 auto;
+	text-align: center;
+	padding: 55px 0;
+}
+
+.verify-img{
+	width: 100%;
+}
+
+.verify_logo {
+	width: 100%;
+	display: block;
+}
+
+.verify-content {
+	border: #F5F5F5 solid 1px;
+	margin: auto;
+	background-color: #FFFFFF;
+	box-shadow: 1px 1px 1px 1px grey;
+	padding: 3vw;
+	display: flex;
+	flex-direction: column;
+}
+
+.verify-content .word {
+	text-align: left;
+	margin: 0px;
+}
+
+#antiimg{
+	width: 100%;
+}
+
+.footBtn {
+	margin-top: 5pt;
+	display: flex;
+	flex-direction: row;
+	justify-content: space-between;
+}
+
+
+
+
+
+* {
+	-webkit-touch-callout:none;
+	-khtml-user-select:none;
+	-moz-user-select:none;
+	-ms-user-select:none;
+	user-select:none;
+}
+a,input,button{
+	outline: none !important;
+	-webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important;
+	-webkit-focus-ring-color: rgba(0, 0, 0, 0) !important;
+}
+/*****app 第一版 布局*****/
+.app-layout-header{
+	line-height: 44px;
+	background-color: #FFFFFF;
+	text-align: center;
+	border-bottom: 1px solid #E6E6E6;
+	font-size: 17px;
+	position: absolute;
+	padding-top: 20px;
+	z-index: 99999;
+	left: 0;
+	right: 0;
+	top: 0;
+	color: #444444;
+}
+.app-layout-header>.app-back{
+	position: absolute;
+	font-size: 19px;
+	padding-top: 20px;
+	padding-left: 11px;
+	padding-right: 40px;
+	padding-bottom: 7px;
+	left: 0px;
+	top: 18px;
+	color: #444444;
+}
+.app-layout-content-a,.app-layout-content-b{
+	position: absolute;
+	top: 44px;
+	padding-top: 20px;
+	overflow-y: auto;
+	bottom: 0px;
+	left: 0px;
+	right:0px;
+	-webkit-overflow-scrolling:touch;
+}
+.app-layout-content-a{
+	bottom: 65px;
+}
+.app-layout-footer {
+	width: 100%;
+	background: #fff;
+	position: fixed;
+	left: 0;
+	bottom: 0;
+	z-index: 99;
+	border-top: 1px solid #E6E6E6;
+	box-sizing: border-box;
+}
+.app-layout-footer ul {
+	width: 100%;
+}
+
+.app-layout-footer ul li {
+	width: 25%;
+	float: left;
+	text-align: center;
+	color: #888888;
+	height: 49px;
+	position: relative;
+}
+
+.app-layout-footer ul li span {
+	font-size: 21px;
+	display: block;
+	width: 100%;
+	text-align: center;
+	margin-top: 10px;
+}
+
+.app-layout-footer ul li p {
+	margin: 0;
+	font-size: 10px;
+	position: absolute;
+	left: 0px;
+	right: 0px;
+	text-align: center;
+	bottom: 2px;
+	line-height: initial;
+}
+
+.app-layout-footer ul li.active span {
+	color: #2CB7CA;
+}
+
+.app-layout-footer ul li.active p {
+	color: #2CB7CA;
+}
+.easyalert{
+	position: fixed;
+	background-color: rgba(0,0,0,0.7);
+	top: 50%;
+	color: #fff;
+	z-index: 999;
+	border-radius: 6px;
+	padding: 17px 20px;
+	font-size: 15px;
+	line-height: 22px;
+	max-width: 260px;
+	text-align: center;
+	display: none;
+}
+.easyalert-icon{
+	font-size: 13px;
+	border-radius: 5px;
+	width: 120px;
+	height: 120px;
+	padding: 0px;
+	left: 50%;
+	right: 50%;
+	margin-top: -60px;
+	margin-left: -60px;
+	margin-right: -60px;
+}
+.jyapp-li-active{
+	background-color: #e5e5e8 !important;
+}
+.app-layout-footer .jyapp-icon-sousuo{
+	font-size: 42px;
+	top: -17px;
+	left: -10.5px;
+}
+/******************/
+.easypopup{
+	background-color: rgba(0,0,0,0.7);
+	position: fixed;
+	left: 0px;
+	right: 0px;
+	top: 0px;
+	bottom: 0px;
+	display: none;
+	z-index: 999;
+	letter-spacing: 1px;
+}
+.easypopup>div{
+	background-color: #fff;
+	position: fixed;
+	left: 50%;
+	top: 50%;
+	margin-left: -140px;
+	border-radius: 4px;
+	overflow: hidden;
+	width: 280px;
+}
+.easypopup .easypopup-edit{
+	width: 300px;
+	margin-left: -150px;
+}
+.easypopup .easypopup-header{
+	padding-top: 29px;
+	padding-bottom: 16px;
+	text-align: center;
+	font-size: 17px;
+	color: #1d1d1d;
+}
+.easypopup .easypopup-main .easypopup-content{
+	padding: 0px 20px 18px 20px;
+	color: #686868;
+}
+.easypopup .easypopup-edit .easypopup-content{
+	padding: 0px 15px 18px 15px;
+	color: #686868;
+}
+.easypopup .easypopup-alert .easypopup-content{
+	padding: 38px 20px 24px 20px;
+}
+.easypopup .easypopup-content{
+	text-align: center;
+	font-size: 15px;
+}
+.easypopup .easypopup-edit [type='text']{
+	height: 37px;
+	border-radius: 3px;
+	font-size: 16px;
+	color: #1d1d1d;
+	padding-left: 10px;
+	width: 100%;
+}
+.easypopup .easypopup-edit ::-webkit-input-placeholder {
+	color: #686868;
+}
+.easypopup .easypopup-footer{
+	text-align: center;
+	border-top: 1px solid #E0E0E0;
+	display: table;
+	width: 100%;
+	font-size: 18px;
+}
+.easypopup .easypopup-footer>span{
+	height: 50px;
+	line-height: 50px;
+	display: table-cell;
+	background-color: #fff;
+}
+.easypopup .easypopup-footer>span:last-child{
+	color: #2cb7ca;
+	border-left: 1px solid #E0E0E0;
+}
+.easypopup .easypopup-footer>span:first-child{
+	border-left: none;
+}
+.easypopup .easypopup-alert .easypopup-footer>span{
+	width: 100%;
+}
+
+/*分享好友弹窗*/
+.share {
+	position: fixed;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	background: rgba(0, 0, 0, 0.6);
+	z-index: 99999;
+	display: none;
+}
+
+.share .shareMain {
+	width: 100%;
+	background: #f4f4f9;
+	position: absolute;
+	left: 0;
+	bottom: 0;
+}
+.share .shareMain ul{
+	background-color: #f4f4f9;
+	height: 120px;
+	padding-top: 32px;
+	box-sizing: border-box;
+}
+.share .shareMain ul li {
+	float: left;
+	text-align: center;
+	margin: 0px 15px;
+}
+
+.share .shareMain ul li span {
+	font-size: 50px;
+}
+
+.share .shareMain ul li span.jyapp-icon-weixin {
+	color: #0ab70e;
+}
+
+.share .shareMain ul li span.jyapp-icon-qq {
+	color: #4cafe9;
+}
+
+.share .shareMain ul li span.jyapp-icon-pengyouquan {
+	color: #a5e537;
+}
+
+.share .shareMain ul li p {
+	font-size: 14px;
+	color: #1D1D1D;
+	margin:0px;
+}
+
+.share .shareMain a.shareQx {
+	display: block;
+	height: 50px;
+	line-height: 50px;
+	text-align: center;
+	background: #fff;
+	font-size: 17px;
+	color:#1d1d1d;
+}
+.clearfix::after, .clearfix::before {
+	content: "";
+	display: block;
+	height: 0;
+	clear: both;
+	overflow: hidden;
+}
+ul, li, ol {
+	list-style: none;
+}
+.clearfix a, .clearfix strong {
+	color: #1d1d1d;
+}
+.jyapp-icon-weixin:before {
+	content: "\AC";
+}
+.redspot{
+	position: absolute;
+	width: 8px;
+	height: 8px;
+	background: #f12c20;
+	border-radius: 100%;
+}
+/* 统一头部 */
+.jy-app-header.app-layout-header .app-layout-content-a, .app-layout-content-b{
+	top: 21.33333vw;
+	padding-top: 0;
+}
+.jy-app-header.app-layout-header {
+	display: flex;
+	width: 100%;
+	justify-content: space-between;
+	align-items: center;
+}
+.jy-app-header.app-layout-header + .paddingtop {
+	padding-top: 21.33333vw;
+}
+.jy-app-header.app-layout-header >.app-back,.jy-app-header.app-layout-header >.app-back_,.jy-app-header.app-layout-header > .header-share {
+	top: auto;
+	bottom: 0;
+	position: unset;
+	padding: 16px 0;
+	position: relative;
+}
+.jy-app-header.app-layout-header span.app-back.jyapp-icon.jyapp-icon-zuojiantou::after {
+	content: "";
+	display: inline-block;
+	width: 4em;
+	height: 100%;
+	position: absolute;
+	top: 0;
+	left: 0;
+}
+.j-header.jy-app-header {
+	height: 21.33333vw;
+	padding: 10.66667vw 3.2vw 0 3.2vw;
+	font-family: inherit;
+	background: inherit;
+}
+
+.jy-app-header {
+	height: 21.33333vw;
+	padding: 10.66667vw 3.2vw 0 3.2vw;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+	background: #fff;
+	font-family: Avenir,Helvetica,Arial,sans-serif;
+}
+.jy-app-header .icon-left {}
+.js_dialog .box .box_bd .weui-icon-checked,
+.vip-check-out .weui-cells_checkbox .weui-check:checked+.weui-icon-checked,
+.vip-check-out .weui-cells_checkbox .weui-check[aria-checked=true]+.weui-icon-checked{
+	color: #2cb7ca;
+}

+ 86 - 0
resources/antiRes/css/default.css

@@ -0,0 +1,86 @@
+body {
+    min-width: auto;
+    font-size: .24rem;
+}
+
+@media only screen and (min-width: 1200px) {
+    body {
+        min-width: 1200px;
+    }
+
+    .verify_logo {
+        width: 350px;
+        display: block;
+    }
+
+    .verify-body {
+        width: 350px;
+        margin: 0 auto;
+        text-align: center;
+        padding: 134px 0;
+    }
+}
+
+@media only screen and (max-width: 1200px) {
+    .verify_logo {
+        width: 7rem;
+        display: block;
+    }
+
+    .verify-body {
+        width: 7rem;
+        margin: 0 auto;
+        text-align: center;
+        padding: 2.38rem 0 0 0;
+    }
+
+    #antiimg {
+        width: 100%;
+    }
+
+}
+
+.logo img {
+    width: 74px;
+}
+
+.j-wx-code > .code-wxm > img {
+    width: 200px;
+    height: 200px;
+    margin-top: -5px;
+}
+
+
+.j-wx-code > .code-bottom > img {
+    position: absolute;
+    left: 280px;
+    top: 88px;
+    -webkit-animation: codeWxMove 10s linear both;
+    -moz-animation: codeWxMove 10s linear both;
+    -o-animation: codeWxMove 10s linear both;
+    animation: codeWxMove 10s linear both;
+    -webkit-animation-fill-mode: forwards;
+    -moz-animation-fill-mode: forwards;
+    -o-animation-fill-mode: forwards;
+    animation-fill-mode: forwards
+}
+
+#antiVerify > div:first-child {
+    display: none;
+}
+
+#antiVerify > div:nth-child(2) {
+    max-width: 360px !important;
+    margin: 0 auto !important;
+    position: unset !important;
+    top: unset !important;
+    left: unset !important;
+    z-index: unset !important;
+    transform:unset !important;
+}
+
+#antiVerify > div:nth-child(2) > div:nth-child(1),
+#antiVerify > div:nth-child(2) > div:nth-child(2),
+#antiVerify > div:nth-child(2) > div:nth-child(1) > img {
+    max-width: 360px !important;
+}

Разница между файлами не показана из-за своего большого размера
+ 3 - 0
resources/antiRes/js/jquery.js


+ 1 - 1
resources/antiRes/js/mainHook.js

@@ -1,4 +1,4 @@
-if (typeof $ === 'function') {
+if (typeof $ === 'function'&& typeof(isSpiderPage)==='undefined') {
     $.ajaxPrefilter(function (options, orginOption, jqXHR) {
         var beforeCallBack = options.success;
         var beforeSettring = orginOption;

+ 19 - 0
resources/antiRes/js/rem.js

@@ -0,0 +1,19 @@
+(function(doc, win) {
+	var docEl = doc.documentElement,
+		resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
+		recalc = function() {
+			var fontSize = RootNodeFontSize();
+			if(fontSize == 0) return;
+			docEl.style.fontSize = fontSize + 'px';
+		};
+	if(!doc.addEventListener) return;
+	win.addEventListener(resizeEvt, recalc, false);
+	doc.addEventListener('DOMContentLoaded', recalc, false);
+})(document, window);
+//获取根节点的font-size
+function RootNodeFontSize(){
+	var clientWidth = document.documentElement.clientWidth;
+	if(!clientWidth) return 0;
+	if(clientWidth > 750) clientWidth = 750;
+	return clientWidth / 7.5;
+}

+ 5 - 58
resources/antiRes/page/app.html

@@ -4,63 +4,10 @@
     <meta charset="UTF-8"/>
     <meta name="format-detection" content="telephone=no, email=no"/>
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-    <link rel="stylesheet" type="text/css" href="/jyapp/css/font.css?v=1429"/>
-    <link href="/jyapp/css/common.css?v=1429" rel="stylesheet">
-    <link href="/jyapp/css/font.css" rel="stylesheet">
-    <link href="/jyapp/css/layout.css" rel="stylesheet">
-    <script src="/jyapp/js/jquery.js"></script>
-    <script src="/jyapp/js/rem.js?v=1429" type="text/javascript" charset="utf-8"></script>
-    <script src="/jyapp/js/common.js?v=1429"></script>
-    <style>
-        .error-body {
-            width: 100%;
-            margin: 0;
-            padding: 0;
-            text-align: center;
-        }
-
-        .verify-body {
-            width: 90vw;
-            margin: 0 auto;
-            text-align: center;
-            padding: 55px 0;
-        }
-
-        .verify-img{
-            width: 100%;
-        }
-
-        .verify_logo {
-            width: 100%;
-            display: block;
-        }
-
-        .verify-content {
-            border: #F5F5F5 solid 1px;
-            margin: auto;
-            background-color: #FFFFFF;
-            box-shadow: 1px 1px 1px 1px grey;
-            padding: 3vw;
-            display: flex;
-            flex-direction: column;
-        }
-
-        .verify-content .word {
-            text-align: left;
-            margin: 0px;
-        }
-
-        #antiimg{
-            width: 100%;
-        }
-
-        .footBtn {
-            margin-top: 5pt;
-            display: flex;
-            flex-direction: row;
-            justify-content: space-between;
-        }
-    </style>
+    <link href="/antiRes/css/app.css?v=1429" rel="stylesheet">
+    <script> let isSpiderPage = true</script>
+    <script src="/antiRes/js/jquery.js"></script>
+    <script src="/antiRes/js/rem.js"></script>
 </head>
 <body>
 <div class="error-body">
@@ -137,4 +84,4 @@
         });
     }
 </script>
-</html>
+</html>

+ 100 - 0
resources/antiRes/page/default.html

@@ -0,0 +1,100 @@
+<html>
+<head>
+    <title>验证码</title>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
+    <meta name="renderer" content="webkit">
+    <meta name="viewport"
+          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
+    <meta name="renderer" content="webkit">
+    <meta name="baidu-site-verification" content="cSFG2PMaYX"/>
+    <meta name="applicable-device" content="pc,mobile"/>
+    <link href="/antiRes/css/default.css?v=1429" rel="stylesheet">
+    <script> let isSpiderPage = true</script>
+    <script src="/antiRes/js/jquery.js"></script>
+    <script src="/antiRes/js/rem.js"></script>
+</head>
+<body>
+<!-- content -->
+<div class="verify-body">
+    <div id="antiVerify">
+        <div></div>
+        <div style="margin: 0 auto;max-width: 360px;">
+            <div style="width: 90vw;max-width: 360px;">
+                <img style="width: 90vw;max-width: 360px;" src="/antiRes/images/verify_logo.png">
+            </div>
+            <div style="width: 90vw;max-width: 360px;border: #F5F5F5 solid 1px;margin: auto;background-color: #FFFFFF;box-shadow: 1px 1px 1px 1px grey;padding: 10pt;display: flex;flex-direction: column;">
+                <div style="margin-bottom:8pt;font-size: .2rem">
+                    <div>请在下图依次点击:<span>{{.textVerify}}</span></div>
+                </div>
+                <div style="position:relative;width:100%">
+                    <img id="antiimg" onclick="antiAdd(event,this);"
+                         src="data:image/png;base64,{{.imgData}}"
+                         style="width:100%"><input type="hidden" id="antivalue"
+                                                   value=""></div>
+                <div style="margin-top: 1vh;display: flex;flex-direction: row;justify-content: space-between;">
+                    <img style="argin-left: 8pt;width: 25pt;height: 25pt;float: left;cursor: hand;"
+                         onclick="antiReload()" src="/antiRes/images/flush.png">
+                    <div>
+                        <button style="background-color: #24C0D7;text-align: center;vertical-align: middle;touch-action: manipulation;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 8px 12px;font-size: 14px;line-height: 1.42857143;border-radius: 4px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;color: #FFFFFF;position: relative;outline-width: 0px;box-shadow: none !important;"
+                                onclick="antiReload(1);">确定
+                        </button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+</div>
+
+<script>
+    //验证码方法
+    function antiAdd(event, obj) {
+        if (obj.parentNode.querySelectorAll(".imgs").length < 3) {
+            var offsetX = event.pageX - (obj.getBoundingClientRect().left + document.body.scrollLeft);
+            var offsetY = event.pageY - (obj.getBoundingClientRect().top + document.body.scrollTop);
+            var offx = parseInt(offsetX);
+            var offy = parseInt(offsetY);
+            var icon = "<img onclick='antiRemove(this)' class='imgs' src='/antiRes/images/hoverclick.png' "
+                + "style='position:absolute;top:" + (offsetY - 8) + "px;left:" + (offsetX - 8) + "px;'   offx=" + offx + " offy=" + offy + " />";
+            obj.parentNode.innerHTML += icon
+            document.querySelector("#antivalue").value += (";" + offx + "," + offy)
+        }
+    }
+
+    //删除验证
+    function antiRemove(obj) {
+        var offx = obj.getAttribute("offx");
+        var offy = obj.getAttribute("offy");
+        document.querySelector("#antivalue").value = document.querySelector("#antivalue").value.replace((";" + offx + "," + offy), "");
+        obj.parentNode.removeChild(obj);
+    }
+
+    //验证码提交
+    function antiReload(flag) {
+        if (flag === 1) {
+            var param = {};
+            param["antiVerifyCheck"] = document.querySelector("#antivalue").value.substr(1);
+            param["imgw"] = $("#antiimg").width();
+            $.ajax({
+                type: "POST",
+                url: window.location.href,
+                dataType: "json",
+                data: param,
+                headers: {
+                    'app': '{{.appName}}',
+                },
+                success: function (res) {
+                    window.location.reload()
+                }
+            });
+        } else {
+            window.location.reload();
+        }
+    }
+
+</script>
+</body>
+</html>

+ 0 - 314
resources/antiRes/page/verify.html

@@ -1,314 +0,0 @@
-<html>
-<head>
-    <title>验证码</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
-    <meta name="renderer" content="webkit">
-    <meta name="viewport"
-          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
-    <script src="/js/jquery.js"></script>
-    <meta content="telephone=no" name="format-detection"/>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
-    <meta name="renderer" content="webkit">
-    <meta name="baidu-site-verification" content="cSFG2PMaYX"/>
-    <meta name="applicable-device" content="pc,mobile"/>
-    <link href="/css/bootstrap.min.css" rel="stylesheet">
-    <link href="/css/bootswatch.min.css" rel="stylesheet">
-    <link href="/css/font.css" rel="stylesheet">
-    <link href="/css/jy.css" rel="stylesheet">
-    <link href="/css/common.css" rel="stylesheet">
-    <link rel="stylesheet" href="/css/unicorn.main.css"/>
-    <link rel="stylesheet" href="/css/unicorn.grey.css"/>
-    <script src="/js/jquery.js"></script>
-    <script src="/js/n_rem.js"></script>
-    <link href="/css/pc.css" rel="stylesheet">
-    <style>
-        body {
-            min-width: auto;
-        }
-
-        @media only screen and (min-width: 1200px) {
-            body {
-                min-width: 1200px;
-            }
-
-            .verify_logo {
-                width: 350px;
-                display: block;
-            }
-
-            .verify-body {
-                width: 350px;
-                margin: 0 auto;
-                text-align: center;
-                padding: 134px 0;
-            }
-
-            .verify-content {
-                border: #F5F5F5 solid 1px;
-                margin: auto;
-                width: 260pt;
-                background-color: #FFFFFF;
-                box-shadow: 1px 1px 1px 1px grey;
-                padding: 10pt;
-                display: flex;
-                flex-direction: column;
-            }
-
-            .public-nav {
-                display: "" !important;
-            }
-
-            .j-bottom {
-                display: "" !important;
-            }
-        }
-
-        @media only screen and (max-width: 1200px) {
-            .verify_logo {
-                width: 7rem;
-                display: block;
-            }
-
-            .verify-body {
-                width: 7rem;
-                margin: 0 auto;
-                text-align: center;
-                padding: 2.38rem 0 0 0;
-            }
-
-            #antiimg {
-                width: 100%;
-            }
-
-            .verify-content {
-                border: #F5F5F5 solid 1px;
-                margin: auto;
-                width: 7rem;
-                background-color: #FFFFFF;
-                box-shadow: 1px 1px 1px 1px grey;
-                padding: 10pt;
-                display: flex;
-                flex-direction: column;
-            }
-
-            .public-nav {
-                display: none !important;
-            }
-
-            .j-bottom {
-                display: none !important;
-            }
-
-        }
-
-        .public-nav {
-            border-bottom: 1px solid #e0e0e0 !important;
-        }
-
-        .fr {
-            float: right;
-        }
-
-        .logo img {
-            width: 74px;
-        }
-
-
-        .verify-content .word {
-            text-align: left;
-        }
-
-        .footBtn {
-            margin-top: 5pt;
-            display: flex;
-            flex-direction: row;
-            justify-content: space-between;
-        }
-
-        /*j-wx-code Start*/
-        .j-wx-code {
-            width: 335px;
-            height: 355px;
-            background-color: #fff;
-            -webkit-border-radius: 6px;
-            -moz-border-radius: 6px;
-            border-radius: 6px;
-            position: relative;
-            /*margin: 100px auto;*/
-        }
-
-        .j-wx-code > .code-close {
-            width: 40px;
-            height: 40px;
-            position: absolute;
-            right: -20px;
-            top: -20px;
-            cursor: pointer;
-            -webkit-transition: all 1s;
-            -o-transition: all 1s;
-            -moz-transition: all 1s;
-            transition: all 1s;
-        }
-
-        .j-wx-code > .code-close:hover {
-            -webkit-transform: scale(1.2);
-            -moz-transform: scale(1.2);
-            -ms-transform: scale(1.2);
-            -o-transform: scale(1.2);
-            transform: scale(1.2);
-        }
-
-        .j-wx-code > .code-title {
-            height: 82px;
-            background: url(/images/j-wx-code-title.png) center center no-repeat;
-            -webkit-animation: moveYun 15s infinite linear both;
-            -moz-animation: moveYun 15s infinite linear both;
-            -o-animation: moveYun 15s infinite linear both;
-            animation: moveYun 15s infinite linear both;
-        }
-
-        .j-wx-code > .code-wxm {
-            text-align: center;
-            margin-bottom: -6px;
-            margin-top: -16px;
-
-        }
-
-        .j-wx-code > .code-wxm > img {
-            width: 200px;
-            height: 200px;
-            margin-top: -5px;
-        }
-
-        .j-wx-code > .code-text {
-            text-align: center;
-        }
-
-        .j-wx-code > .code-bottom {
-            width: 470px;
-            height: 211px;
-            position: absolute;
-            bottom: -113px;
-            left: -73px;
-            background: url(/images/j-wx-code-bottom.png) 0 0 no-repeat;
-        }
-
-        .j-wx-code > .code-bottom > img {
-            position: absolute;
-            left: 280px;
-            top: 88px;
-            -webkit-animation: codeWxMove 10s linear both;
-            -moz-animation: codeWxMove 10s linear both;
-            -o-animation: codeWxMove 10s linear both;
-            animation: codeWxMove 10s linear both;
-            -webkit-animation-fill-mode: forwards;
-            -moz-animation-fill-mode: forwards;
-            -o-animation-fill-mode: forwards;
-            animation-fill-mode: forwards
-        }
-
-        #antiVerify > div:first-child {
-            display: none;
-        }
-
-        #antiVerify > div:nth-child(2) {
-            max-width: 360px !important;
-            margin: 0 auto !important;
-            position: unset !important;
-            top: unset !important;
-            left: unset !important;
-            z-index: unset !important;
-            transform:unset !important;
-        }
-
-        #antiVerify > div:nth-child(2) > div:nth-child(1),
-        #antiVerify > div:nth-child(2) > div:nth-child(2),
-        #antiVerify > div:nth-child(2) > div:nth-child(1) > img {
-            max-width: 360px !important;
-        }
-    </style>
-</head>
-<body>
-<!-- content -->
-<div class="verify-body">
-    <div id="antiVerify">
-        <div></div>
-        <div style="margin: 0 auto;max-width: 360px;">
-            <div style="width: 90vw;max-width: 360px;">
-                <img style="width: 90vw;max-width: 360px;" src="/antiRes/images/verify_logo.png">
-            </div>
-            <div style="width: 90vw;max-width: 360px;border: #F5F5F5 solid 1px;margin: auto;background-color: #FFFFFF;box-shadow: 1px 1px 1px 1px grey;padding: 10pt;display: flex;flex-direction: column;">
-                <div style="margin-bottom:8pt">
-                    <div>请在下图依次点击:<span>{{.textVerify}}</span></div>
-                </div>
-                <div style="position:relative;width:100%">
-                    <img id="antiimg" onclick="antiAdd(event,this);"
-                         src="data:image/png;base64,{{.imgData}}"
-                         style="width:100%"><input type="hidden" id="antivalue"
-                                                   value=""></div>
-                <div style="margin-top: 1vh;display: flex;flex-direction: row;justify-content: space-between;">
-                    <img style="argin-left: 8pt;width: 25pt;height: 25pt;float: left;cursor: hand;"
-                         onclick="antiReload()" src="/antiRes/images/flush.png">
-                    <div>
-                        <button style="background-color: #24C0D7;text-align: center;vertical-align: middle;touch-action: manipulation;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 8px 12px;font-size: 14px;line-height: 1.42857143;border-radius: 4px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;color: #FFFFFF;position: relative;outline-width: 0px;box-shadow: none !important;"
-                                onclick="antiReload(1);">确定
-                        </button>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-</div>
-<img src="/images/pc_6.png" class="backTop" id="backTop">
-
-<script>
-    //验证码方法
-    function antiAdd(event, obj) {
-        if (obj.parentNode.querySelectorAll(".imgs").length < 3) {
-            var offsetX = event.pageX - (obj.getBoundingClientRect().left + document.body.scrollLeft);
-            var offsetY = event.pageY - (obj.getBoundingClientRect().top + document.body.scrollTop);
-            var offx = parseInt(offsetX);
-            var offy = parseInt(offsetY);
-            var icon = "<img onclick='antiRemove(this)' class='imgs' src='/antiRes/images/hoverclick.png' "
-                + "style='position:absolute;top:" + (offsetY - 8) + "px;left:" + (offsetX - 8) + "px;'   offx=" + offx + " offy=" + offy + " />";
-            obj.parentNode.innerHTML += icon
-            document.querySelector("#antivalue").value += (";" + offx + "," + offy)
-        }
-    }
-
-    //删除验证
-    function antiRemove(obj) {
-        var offx = obj.getAttribute("offx");
-        var offy = obj.getAttribute("offy");
-        document.querySelector("#antivalue").value = document.querySelector("#antivalue").value.replace((";" + offx + "," + offy), "");
-        obj.parentNode.removeChild(obj);
-    }
-
-    //验证码提交
-    function antiReload(flag) {
-        if (flag === 1) {
-            var param = {};
-            param["antiVerifyCheck"] = document.querySelector("#antivalue").value.substr(1);
-            param["imgw"] = $("#antiimg").width();
-            $.ajax({
-                type: "POST",
-                url: window.location.href,
-                dataType: "json",
-                data: param,
-                headers: {
-                    'app': '{{.appName}}',
-                },
-                success: function (res) {
-                    window.location.reload()
-                }
-            });
-        } else {
-            window.location.reload();
-        }
-    }
-
-</script>
-</body>
-</html>

Некоторые файлы не были показаны из-за большого количества измененных файлов