H5-contact/dist/build/h5/assets/_plugin-vue_export-helper.C...

2 lines
2.1 KiB
JavaScript

import{B as t,C as n,D as e}from"./index-BeUtwrrb.js";const o="LOGIN_STATUS_TOKEN";function r(t){return String(t||"").trim().replace(/^Bearer\s+/i,"")}function i(t){try{return decodeURIComponent(String(t||"").replace(/\+/g,"%20"))}catch(n){return String(t||"")}}function c(t){const n=["token","remote_token","access_token","Authori-zation","Authorization"],e=String(t||"").replace(/^[?#&]/,"");if(!e)return"";const o=e.split("&");for(let c=0;c<o.length;c+=1){const t=o[c],e=t.indexOf("="),s=i(e>=0?t.slice(0,e):t),u=i(e>=0?t.slice(e+1):"");if(-1!==n.indexOf(s)&&u)return r(u)}return""}function s(t){const n=String(t||"").trim();if(!n)return"";const e=n.indexOf("?");if(-1!==e){const t=n.indexOf("#",e),o=c(n.slice(e+1,-1===t?n.length:t));if(o)return o}const o=n.indexOf("#");if(-1!==o){const t=n.slice(o+1),e=t.indexOf("?"),r=c(-1===e?t:t.slice(e+1));if(r)return r}return c(n)}function u(n){const e=r(n);return e?(t(o,e),e):""}function f(){return r(n(o))}function a(t){const n=[],e=String(t||"").trim(),o=String(("undefined"!=typeof window&&window.location?window.location.href:"")||"").trim(),r="undefined"!=typeof document&&document.referrer||"";e&&n.push(e),o&&-1===n.indexOf(o)&&n.push(o),r&&-1===n.indexOf(r)&&n.push(r);for(let i=0;i<n.length;i+=1){const t=s(n[i]);if(t)return u(t)}return f()}function d(t){const n=String(t||"");return/^https?:\/\//i.test(n)?n:("undefined"!=typeof window&&window.location?window.location.protocol+"//"+window.location.host:"")+("/"===n.charAt(0)?n:"/"+n)}function l(){const t={"content-type":"application/json",is_release:1,"Form-type":"gzh"},n=f();return n&&(t["Authori-zation"]="Bearer "+n),t}function p(t,n){return function(t,n,o){return new Promise((r,i)=>{e({url:d(t),method:n,data:o||{},header:l(),timeout:15e3,success(t){const n=t.data;n&&"object"==typeof n&&void 0!==n.status&&200!==n.status?i(n):r(n)},fail(t){i(t)}})})}(t,"GET",n)}function h(t){return p("/api/jz_contract/contract_list",t)}function w(t){return p("/api/jz_contract/contract_detail",t)}const g=(t,n)=>{const e=t.__vccOpts||t;for(const[o,r]of n)e[o]=r;return e};export{g as _,w as a,h as g,a as r};