@jxstjh/auth-client
Advanced tools
Comparing version 0.1.5-beat2 to 0.1.5-beat3
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r={get(e,t=null){return this.fetch("GET",e,t)},post(e,t=null){return this.fetch("POST",e,t)},put(e,t=null){return this.fetch("PUT",e,t)},del(e,t=null){return this.fetch("DELETE",e,t)},ajax:(e,t,n,r={})=>new Promise((o,s)=>{let u=new XMLHttpRequest;u.responseType="json",u.onload=()=>{switch(u.status){case 200:o(u.response);break;case 204:o();break;case 401:s();break;default:s({status:u.status,res:u.response})}},n&&(n=JSON.stringify(n)),u.open(e,t,!0),Object.entries(r).forEach(([e,t])=>{u.setRequestHeader(e,t)}),u.setRequestHeader("Content-type","application/json"),u.send(n)}),fetch(e,t,n){if(window&&!window.fetch)return this.ajax(e,t,n);let r=[],o={method:e,mode:"cors",headers:{"Content-Type":"application/json"}};if(n){for(let e in n)r.push(`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`);"GET"===e?t+="?"+r.join("&"):o.body=JSON.stringify(n)}return fetch(t,o).then(e=>{switch(e.status){case 200:return e.json();case 204:break;case 401:return Promise.reject();case 403:return e.json().then(e=>Promise.reject(e));default:return Promise.reject({status_code:500,message:"服务器繁忙, 请稍后再试"})}})}};onmessage=function(e){switch(e.data.cmd){case"UPLOADLOGLIST":!function(e,t=[]){const n=t.map(e=>e.uId);r.ajax("POST",e+"/log-frontend/frontend/send",t).then((function(e){e.code-0==0&&postMessage({cmd:"UPLOAD_SUCCESS",ids:n})})).catch(e=>{console.log(e)})}(e.data.url,e.data.row)}}}]); | ||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var o={get(e,t=null){return this.fetch("GET",e,t)},post(e,t=null){return this.fetch("POST",e,t)},put(e,t=null){return this.fetch("PUT",e,t)},del(e,t=null){return this.fetch("DELETE",e,t)},ajax:(e,t,n,o={})=>new Promise((r,s)=>{let a=new XMLHttpRequest;a.responseType="json",a.onload=()=>{switch(a.status){case 200:r(a.response);break;case 204:r();break;case 401:s();break;default:s({status:a.status,res:a.response})}},n&&(n=JSON.stringify(n)),a.open(e,t,!0),Object.entries(o).forEach(([e,t])=>{a.setRequestHeader(e,t)}),a.setRequestHeader("Content-type","application/json"),a.send(n)}),fetch(e,t,n){if(window&&!window.fetch)return this.ajax(e,t,n);let o=[],r={method:e,mode:"cors",headers:{"Content-Type":"application/json"}};if(n){for(let e in n)o.push(`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`);"GET"===e?t+="?"+o.join("&"):r.body=JSON.stringify(n)}return fetch(t,r).then(e=>{switch(e.status){case 200:return e.json();case 204:break;case 401:return Promise.reject();case 403:return e.json().then(e=>Promise.reject(e));default:return Promise.reject({status_code:500,message:"服务器繁忙, 请稍后再试"})}})}};onmessage=function(e){switch(e.data.cmd){case"UPLOADLOGLIST":const t=e.data.url,n=e.data.log;!function(e,t,n=[],r){const s=n.map(e=>e.id),a=(e=>{const t=[];for(;e.length>0;){const n=e.pop();if(t.find(e=>e.login_name===n.login_name)){const e=t.find(e=>e.login_name===n.login_name&&e.log_type===n.log_type);e?e.count+=1:t.push(n)}else t.push(n)}return t})(n).map(e=>({appId:t,count:e.count,dataType:e.log_type,identify:e.login_name})),c={"Stjh-Real-IP":r+""};o.ajax("post",e+"/site-statistics",a,c).then((function(e){0===e.code&&postMessage({cmd:"UPLOAD_SUCCESS",ids:s})})).catch((function(e){}))}(t,e.data.appId,n,e.data.ip);break;case"GETIP":o.ajax("get","//pv.sohu.com/cityjson?ie=utf-8",null,{}).then((function(e){console.log(e,"--")})).catch((function(e){}))}}}]); |
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r={get(e,t=null){return this.fetch("GET",e,t)},post(e,t=null){return this.fetch("POST",e,t)},put(e,t=null){return this.fetch("PUT",e,t)},del(e,t=null){return this.fetch("DELETE",e,t)},ajax:(e,t,n,r={})=>new Promise((o,s)=>{let u=new XMLHttpRequest;u.responseType="json",u.onload=()=>{switch(u.status){case 200:o(u.response);break;case 204:o();break;case 401:s();break;default:s({status:u.status,res:u.response})}},n&&(n=JSON.stringify(n)),u.open(e,t,!0),Object.entries(r).forEach(([e,t])=>{u.setRequestHeader(e,t)}),u.setRequestHeader("Content-type","application/json"),u.send(n)}),fetch(e,t,n){if(window&&!window.fetch)return this.ajax(e,t,n);let r=[],o={method:e,mode:"cors",headers:{"Content-Type":"application/json"}};if(n){for(let e in n)r.push(`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`);"GET"===e?t+="?"+r.join("&"):o.body=JSON.stringify(n)}return fetch(t,o).then(e=>{switch(e.status){case 200:return e.json();case 204:break;case 401:return Promise.reject();case 403:return e.json().then(e=>Promise.reject(e));default:return Promise.reject({status_code:500,message:"服务器繁忙, 请稍后再试"})}})}};onmessage=function(e){switch(e.data.cmd){case"UPLOADLOGLIST":!function(e,t=[]){const n=t.map(e=>e.uId);r.ajax("POST",e+"/log-frontend/frontend/send",t).then((function(e){e.code-0==0&&postMessage({cmd:"UPLOAD_SUCCESS",ids:n})})).catch(e=>{console.log(e)})}(e.data.url,e.data.row)}}}]); | ||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var o={get(e,t=null){return this.fetch("GET",e,t)},post(e,t=null){return this.fetch("POST",e,t)},put(e,t=null){return this.fetch("PUT",e,t)},del(e,t=null){return this.fetch("DELETE",e,t)},ajax:(e,t,n,o={})=>new Promise((r,s)=>{let a=new XMLHttpRequest;a.responseType="json",a.onload=()=>{switch(a.status){case 200:r(a.response);break;case 204:r();break;case 401:s();break;default:s({status:a.status,res:a.response})}},n&&(n=JSON.stringify(n)),a.open(e,t,!0),Object.entries(o).forEach(([e,t])=>{a.setRequestHeader(e,t)}),a.setRequestHeader("Content-type","application/json"),a.send(n)}),fetch(e,t,n){if(window&&!window.fetch)return this.ajax(e,t,n);let o=[],r={method:e,mode:"cors",headers:{"Content-Type":"application/json"}};if(n){for(let e in n)o.push(`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`);"GET"===e?t+="?"+o.join("&"):r.body=JSON.stringify(n)}return fetch(t,r).then(e=>{switch(e.status){case 200:return e.json();case 204:break;case 401:return Promise.reject();case 403:return e.json().then(e=>Promise.reject(e));default:return Promise.reject({status_code:500,message:"服务器繁忙, 请稍后再试"})}})}};onmessage=function(e){switch(e.data.cmd){case"UPLOADLOGLIST":const t=e.data.url,n=e.data.log;!function(e,t,n=[],r){const s=n.map(e=>e.id),a=(e=>{const t=[];for(;e.length>0;){const n=e.pop();if(t.find(e=>e.login_name===n.login_name)){const e=t.find(e=>e.login_name===n.login_name&&e.log_type===n.log_type);e?e.count+=1:t.push(n)}else t.push(n)}return t})(n).map(e=>({appId:t,count:e.count,dataType:e.log_type,identify:e.login_name})),c={"Stjh-Real-IP":r+""};o.ajax("post",e+"/site-statistics",a,c).then((function(e){0===e.code&&postMessage({cmd:"UPLOAD_SUCCESS",ids:s})})).catch((function(e){}))}(t,e.data.appId,n,e.data.ip);break;case"GETIP":o.ajax("get","//pv.sohu.com/cityjson?ie=utf-8",null,{}).then((function(e){console.log(e,"--")})).catch((function(e){}))}}}]); |
{ | ||
"name": "@jxstjh/auth-client", | ||
"version": "0.1.5-beat2", | ||
"version": "0.1.5-beat3", | ||
"description": "匹配4a认证的客户端工具包 🌼", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
320983
7