优惠券 PC管理端 项目

436.03529eb6.js 7.9KB

1
  1. "use strict";(self["webpackChunkcoupon"]=self["webpackChunkcoupon"]||[]).push([[436],{43:function(e,t,n){n.d(t,{w:function(){return a}});var o=n(1020),l=n(1423),s=n(6573);const a=(0,o.Q_)({id:"globalTbAccount",state:()=>({globalTbAccountId:"",globalTbAccountIdOptions:[]}),actions:{async getGlobalTbAccountIdOptions(){return new Promise((async e=>{try{const{code:t,data:n,msg:o}=await l.Z.get(s.W.tbAccount_listTbAccount);0===t&&Array.isArray(n)?this.globalTbAccountIdOptions=n:this.globalTbAccountIdOptions=[],e(n)}catch(t){}}))},initGlobalTbAccountId(){this.globalTbAccountIdOptions.length?this.setGlobalTbAccountId(this.globalTbAccountIdOptions[0].accountId):this.clearGlobalTbAccountId()},setGlobalTbAccountId(e){this.globalTbAccountId=e},clearGlobalTbAccountId(){this.globalTbAccountId=""}},persist:!0})},4037:function(e,t,n){n.r(t),n.d(t,{default:function(){return P}});var o=n(212),l=(n(3163),n(9866)),s=(n(172),n(3396)),a=n(7139),i=n(4870),c=n(6629),r=(n(7228),n(1423)),u=n(6573),d=n(2483),b=n(6294),p=n(43),v=n(4147);const m=e=>((0,s.dD)("data-v-41b26b76"),e=e(),(0,s.Cn)(),e),g={class:"page flex-col"},f={class:"version"},w={class:"section_28 flex-col"},y={class:"box_30 flex-col"},x={class:"block_15 flex-col"},h=m((()=>(0,s._)("span",{class:"text_139"},"登录",-1))),A={class:"form-item",style:{"margin-top":"30px"}},T=m((()=>(0,s._)("div",{class:"input-label"},"账号",-1))),k={class:"form-item",style:{"margin-top":"10px"}},C=m((()=>(0,s._)("div",{class:"input-label"},"密码",-1))),I=m((()=>(0,s._)("span",{class:"text_144"},"立即登录",-1))),_=[I],V=m((()=>(0,s._)("img",{class:"image_2",referrerpolicy:"no-referrer",src:"https://kx-coupon.oss-cn-beijing.aliyuncs.com/login_bg.png"},null,-1)));var L=(0,s.aZ)({__name:"index",setup(e){const t=v.i8,n=(0,b.L)(),m=(0,p.w)(),I=(0,d.tv)();let L=null;const O=(0,i.iH)(!1),B=(0,i.qj)({username:"",password:""});(0,s.Jd)((()=>{clearTimeout(L),L=null}));const P=async()=>{try{await $(),G()}catch(e){}},$=()=>new Promise(((e,t)=>{const{username:n,password:o}=B;""===n?(c.z8.warning("请输入账号"),t("校验未通过")):""===o?(c.z8.warning("请输入密码"),t("校验未通过")):e("校验通过")})),G=async()=>{try{O.value=!0;const e=await r.Z.post(u.W.login_login_php,{...B});return 0==e?.code&&e?.data.token?(c.z8.success("登录成功"),n.setToken(e.data.token),await m.getGlobalTbAccountIdOptions(),m.initGlobalTbAccountId(),L=setTimeout((()=>{I.replace("/")}),1e3),Promise.resolve(e)):(c.z8.error(e?.msg||"登录失败"),n.clearToken(),Promise.reject(e?.msg||"登录失败"))}catch(e){return 401===e?.response?.data?.code&&(c.z8.error(e?.response?.data?.msg||"登录失败"),n.clearToken()),Promise.reject(e)}finally{O.value=!1}};return(e,n)=>{const c=l.EZ,r=o.t;return(0,s.wg)(),(0,s.iD)("div",g,[(0,s._)("span",f,"v"+(0,a.zw)((0,i.SU)(t)),1),(0,s._)("div",w,[(0,s._)("div",y,[(0,s.wy)(((0,s.wg)(),(0,s.iD)("div",x,[h,(0,s._)("div",A,[T,(0,s.Wm)(c,{class:"form-input",modelValue:B.username,"onUpdate:modelValue":n[0]||(n[0]=e=>B.username=e),placeholder:"请输入账号"},null,8,["modelValue"])]),(0,s._)("div",k,[C,(0,s.Wm)(c,{class:"form-input",modelValue:B.password,"onUpdate:modelValue":n[1]||(n[1]=e=>B.password=e),placeholder:"请输入密码",type:"password","show-password":""},null,8,["modelValue"])]),(0,s._)("div",{class:"text-wrapper_52 flex-col",onClick:P},_)])),[[r,O.value]]),V])])])}}}),O=n(89);const B=(0,O.Z)(L,[["__scopeId","data-v-41b26b76"]]);var P=B},212:function(e,t,n){n.d(t,{t:function(){return x}});var o=n(4870),l=n(7139),s=n(3396),a=n(6413),i=n(9242),c=n(6734),r=n(529);function u(e){let t;const n=(0,c.s)("loading"),l=(0,o.iH)(!1),a=(0,o.qj)({...e,originalPosition:"",originalOverflow:"",visible:!1});function u(e){a.text=e}function d(){const e=a.parent;if(!e.vLoadingAddClassList){let t=e.getAttribute("loading-number");t=Number.parseInt(t)-1,t?e.setAttribute("loading-number",t.toString()):((0,r.IV)(e,n.bm("parent","relative")),e.removeAttribute("loading-number")),(0,r.IV)(e,n.bm("parent","hidden"))}b(),g.unmount()}function b(){var e,t;null==(t=null==(e=f.$el)?void 0:e.parentNode)||t.removeChild(f.$el)}function p(){var n;e.beforeClose&&!e.beforeClose()||(l.value=!0,clearTimeout(t),t=window.setTimeout(v,400),a.visible=!1,null==(n=e.closed)||n.call(e))}function v(){if(!l.value)return;const e=a.parent;l.value=!1,e.vLoadingAddClassList=void 0,d()}const m={name:"ElLoading",setup(){return()=>{const e=a.spinner||a.svg,t=(0,s.h)("svg",{class:"circular",viewBox:a.svgViewBox?a.svgViewBox:"25 25 50 50",...e?{innerHTML:e}:{}},[(0,s.h)("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none"})]),o=a.text?(0,s.h)("p",{class:n.b("text")},[a.text]):void 0;return(0,s.h)(i.uT,{name:n.b("fade"),onAfterLeave:v},{default:(0,s.w5)((()=>[(0,s.wy)((0,s.Wm)("div",{style:{backgroundColor:a.background||""},class:[n.b("mask"),a.customClass,a.fullscreen?"is-fullscreen":""]},[(0,s.h)("div",{class:n.b("spinner")},[t,o])]),[[i.F8,a.visible]])]))})}}},g=(0,i.ri)(m),f=g.mount(document.createElement("div"));return{...(0,o.BK)(a),setText:u,removeElLoadingChild:b,close:p,handleAfterLeave:v,vm:f,get $el(){return f.$el}}}var d=n(7750);let b;const p=function(e={}){if(!a.C5)return;const t=v(e);if(t.fullscreen&&b)return b;const n=u({...t,closed:()=>{var e;null==(e=t.closed)||e.call(t),t.fullscreen&&(b=void 0)}});m(t,t.parent,n),g(t,t.parent,n),t.parent.vLoadingAddClassList=()=>g(t,t.parent,n);let o=t.parent.getAttribute("loading-number");return o=o?`${Number.parseInt(o)+1}`:"1",t.parent.setAttribute("loading-number",o),t.parent.appendChild(n.$el),(0,s.Y3)((()=>n.visible.value=t.visible)),t.fullscreen&&(b=n),n},v=e=>{var t,n,o,s;let a;return a=(0,l.HD)(e.target)?null!=(t=document.querySelector(e.target))?t:document.body:e.target||document.body,{parent:a===document.body||e.body?document.body:a,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:a===document.body&&(null==(n=e.fullscreen)||n),lock:null!=(o=e.lock)&&o,customClass:e.customClass||"",visible:null==(s=e.visible)||s,target:a}},m=async(e,t,n)=>{const{nextZIndex:o}=(0,d.C)(),l={};if(e.fullscreen)n.originalPosition.value=(0,r.C2)(document.body,"position"),n.originalOverflow.value=(0,r.C2)(document.body,"overflow"),l.zIndex=o();else if(e.parent===document.body){n.originalPosition.value=(0,r.C2)(document.body,"position"),await(0,s.Y3)();for(const t of["top","left"]){const n="top"===t?"scrollTop":"scrollLeft";l[t]=e.target.getBoundingClientRect()[t]+document.body[n]+document.documentElement[n]-Number.parseInt((0,r.C2)(document.body,`margin-${t}`),10)+"px"}for(const t of["height","width"])l[t]=`${e.target.getBoundingClientRect()[t]}px`}else n.originalPosition.value=(0,r.C2)(t,"position");for(const[s,a]of Object.entries(l))n.$el.style[s]=a},g=(e,t,n)=>{const o=(0,c.s)("loading");["absolute","fixed","sticky"].includes(n.originalPosition.value)?(0,r.IV)(t,o.bm("parent","relative")):(0,r.cn)(t,o.bm("parent","relative")),e.fullscreen&&e.lock?(0,r.cn)(t,o.bm("parent","hidden")):(0,r.IV)(t,o.bm("parent","hidden"))},f=Symbol("ElLoading"),w=(e,t)=>{var n,s,a,i;const c=t.instance,r=e=>(0,l.Kn)(t.value)?t.value[e]:void 0,u=e=>{const t=(0,l.HD)(e)&&(null==c?void 0:c[e])||e;return t?(0,o.iH)(t):t},d=t=>u(r(t)||e.getAttribute(`element-loading-${(0,l.rs)(t)}`)),b=null!=(n=r("fullscreen"))?n:t.modifiers.fullscreen,v={text:d("text"),svg:d("svg"),svgViewBox:d("svgViewBox"),spinner:d("spinner"),background:d("background"),customClass:d("customClass"),fullscreen:b,target:null!=(s=r("target"))?s:b?void 0:e,body:null!=(a=r("body"))?a:t.modifiers.body,lock:null!=(i=r("lock"))?i:t.modifiers.lock};e[f]={options:v,instance:p(v)}},y=(e,t)=>{for(const n of Object.keys(t))(0,o.dq)(t[n])&&(t[n].value=e[n])},x={mounted(e,t){t.value&&w(e,t)},updated(e,t){const n=e[f];t.oldValue!==t.value&&(t.value&&!t.oldValue?w(e,t):t.value&&t.oldValue?(0,l.Kn)(t.value)&&y(t.value,n.options):null==n||n.instance.close())},unmounted(e){var t;null==(t=e[f])||t.instance.close()}}},3163:function(e,t,n){n(1758)},4147:function(e){e.exports={i8:"0.1.7"}}}]);