ss-component-new 1.1.722 → 1.1.724
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$=require("vue-router"),x=require("./login-D-3kbcCv.cjs"),m=require("./index-BKUqLOwQ.cjs"),z=require("./crypto-CRbcEKIz.cjs"),I=require("./index-xsqiMVT2.cjs"),ee={},te={class:"left-wrap"},ae={class:"left-bg"};function oe(v,E){return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",ae,[e.renderSlot(v.$slots,"img",{},void 0,!0)])])}const ne=B._export_sfc(ee,[["render",oe],["__scopeId","data-v-9b7ee6c9"]]),se={class:"right-wrap"},re={class:"right-title"},ce={class:"right-content"},le={class:"tab-content"},ie={class:"tab-tips"},de=e.defineComponent({__name:"index",props:{tabList:{type:Array,default:[]},loading:{type:Boolean,default:!1}},emits:["clickLogin","handleTabClick"],setup(v,{emit:E}){const y=e.ref("account"),r=E,p=()=>{r("clickLogin",y.value)},b=()=>{r("handleTabClick",y.value)};return(u,A)=>{const i=e.resolveComponent("el-button"),f=e.resolveComponent("el-tab-pane"),C=e.resolveComponent("el-tabs");return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",re,[e.renderSlot(u.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",ce,[e.createVNode(C,{modelValue:y.value,"onUpdate:modelValue":A[0]||(A[0]=N=>y.value=N),class:"right-tabs",onTabClick:b},{default:e.withCtx(()=>[e.createVNode(f,{name:"account"},{label:e.withCtx(()=>[e.renderSlot(u.$slots,"tabLabel2",{},void 0,!0)]),default:e.withCtx(()=>[e.createElementVNode("div",le,[e.renderSlot(u.$slots,"tabContent2",{},void 0,!0)]),e.createElementVNode("div",{class:"tab-button special",onClick:p},[e.createVNode(i,{loading:v.loading},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"tabButton2",{},void 0,!0)]),_:3},8,["loading"])]),e.createElementVNode("div",ie,[e.renderSlot(u.$slots,"tabTips2",{},void 0,!0)])]),_:3})]),_:3},8,["modelValue"])])])}}}),ue=B._export_sfc(de,[["__scopeId","data-v-3ebcb6e2"]]),pe={class:"account-wrap"},fe=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""},isClickLogin:{type:Boolean,default:!1}},emits:["handleLoginFormChange"],setup(v,{emit:E}){const y=v,r=e.reactive({account:"",password:""}),p=e.reactive({account:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}),b=e.ref(null),u=E;return e.watch(()=>y.isClickLogin,A=>{var i;A&&((i=b.value)==null||i.validate(f=>{u("handleLoginFormChange",f,f?r:null)}))},{immediate:!0}),e.watch(()=>y.activeTabName,A=>{var i;A&&((i=b.value)==null||i.resetFields())}),(A,i)=>{const f=e.resolveComponent("svg-icon"),C=e.resolveComponent("el-input"),N=e.resolveComponent("el-form-item"),T=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(T,{model:r,rules:p,ref_key:"formRef",ref:b},{default:e.withCtx(()=>[e.createVNode(N,{label:"",prop:"account"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:r.account,"onUpdate:modelValue":i[0]||(i[0]=w=>r.account=w),placeholder:"请输入账号",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(f,{name:"account",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(N,{label:"",prop:"password"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:r.password,"onUpdate:modelValue":i[1]||(i[1]=w=>r.password=w),type:"password",placeholder:"请输入密码","show-password":"",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(f,{name:"password",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])}}}),ye=B._export_sf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/sbHxbjwe/13NpioBrXUcwB0iarUBrnBmipnPiUh6KfslCXiet9/3/af/CFxmppQ6nEgkhiv5qkhAa90N4Ob/AC/5YOZLItK30OciAlrrAwAe24Iz8yul1A0imgPQ5ft+75LpZj4qIi+D/5cRMILLZDJejTXvcRxnwDgdGxtrzufzS9abiKZisVgiKMwyAlrr8wCu2UZvzjHzgIj0mHet9fH59uyvqnrmXhG5/bc0pZehoaFYNBpN27ZaoLY/mPk1EeUAmDnRFEJgZnZ2Nt7Z2ZkpBFA6rLXeB+B5LdEXM/ARwPZa7Jg5KSJvygi4rnuFiC7aOlJKPSCiR4lEYrw4L0aIaKWl/S3HcS6XEfA8b9T3/d2WDoxORhzHmQxk0JSv2cZeKfVunnj7whJ8ALDNwkFBpMy8Q0SOBQhMA9hkYW9sv4jIzoUEvgFYbeHAEOgFcKK9vf1JUf0tAN5b2BaOMPMvETHLrEyEtgQKTmKx2NpSP7uue4GIri6XgG0JTARDInIkkP5hs6ZrILC4BLWIkJlPicigAZyYmIjOzc19twU35yqKsJY2zGazG5PJZNY4c103SUQPayFARIvb0HYQMfOoiBwMpL8PwEkiMkPMkAl9Kg4i21HMzGdF5F4JxfO8TwA+Axg33RGGzsyVR3GxnUKXETM3iUih5lrrFiK6T0TdRPQCwCoLApWXkTG0WceRSKS1ra1tugSUSqWa5397RkRbwsBD13ExqqoXEqXUYD6fvx6JRLYCOEREXQDWWYCb9q1+IQkIq35XsoC46ncpDWSiftfyEom6fpgEhVW3TzMbdS/nTOi34XKc29j+AXyzojCfNKqJAAAAAElFTkSuQmCC",Ae={class:"card-wrap"},he={class:"card-icon card"},be={class:"card-input"},ve={class:"card-icon info"},_e=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""}},emits:["handleCardInput"],setup(v,{emit:E}){const y=v,r=e.ref(""),p=E,b=u=>{p("handleCardInput",u)};return e.watch(()=>y.activeTabName,u=>{u&&(r.value="")}),(u,A)=>{const i=e.resolveComponent("el-image"),f=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",he,[e.createVNode(i,{src:e.unref(ge),fit:"contain"},null,8,["src"])]),e.createElementVNode("div",be,[e.createVNode(f,{modelValue:r.value,"onUpdate:modelValue":A[0]||(A[0]=C=>r.value=C),onChange:b,clearable:""},null,8,["modelValue"])]),e.createElementVNode("div",ve,[e.createVNode(i,{src:e.unref(me),fit:"contain"},null,8,["src"])])])}}}),Ce=B._export_sfc(_e,[["__scopeId","data-v-23f91251"]]),we=x.useMenuState(x.pinia),X=x.useLoginState(x.pinia),G=e.ref(!1),Z=e.ref(!1),Ee=async()=>{const v=m.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),E=m.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}});return await Promise.all([v,E]).then(y=>{var b,u,A,i,f,C,N,T,w,V,U,P,L,D;const r=y==null?void 0:y[0],p=y==null?void 0:y[1];if(r.data.code===200){const Q=(N=(C=(f=(i=(A=(u=(b=r==null?void 0:r.data)==null?void 0:b.result)==null?void 0:u[0])==null?void 0:A.value)==null?void 0:i.pageData)==null?void 0:f.compData)==null?void 0:C[0])==null?void 0:N.contents;we.setRawMenus(Q??[]),G.value=((T=r==null?void 0:r.data)==null?void 0:T.result)&&((V=(w=r==null?void 0:r.data)==null?void 0:w.result)==null?void 0:V.length)>0}else m.ElMessage.error("获取模型菜单响应失败");p.data.code===200?p.data.result&&((U=p.data.result)==null?void 0:U.length)>0&&(X.setStructureData(p.data.result),X.setIsStructureExist(!0),Z.value=((P=p==null?void 0:p.data)==null?void 0:P.result)&&((D=(L=p==null?void 0:p.data)==null?void 0:L.result)==null?void 0:D.length)>0):m.ElMessage.error("获取模型结构响应失败")}),{menuExist:G.value,structureExist:Z.value}};function Ne(){const v={account:"superadmin",password:"1c8e7623312244c1feb677732278fb8b2af6af1a5335fdaebbdb2720137b372b7871292d11165b83b2967b9c39fa37027d63d37a2f36d764257b566dcfa99f334faa8995301601aec549adf39aef8d89c8788da03a9164937a5f73af20a15ea60d47c7cf01cf",tenantId:-1,code:"",codeId:0};return m.service({url:"/api/sysAuth/login",method:"post",data:v})}const Se={class:"login-wrap"},ke={class:"login-body"},Ie={class:"login-body-item left"},xe={class:"title"},Te={class:"login-body-item right"},Ve=e.defineComponent({__name:"index",emits:["change"],setup(v,{emit:E}){const y=$.useRouter(),r=x.useLoginState(x.pinia),{systemKey:p,systemInfo:b}=x.storeToRefs(r),u=e.ref({sysCTitle:"",sysETitle:"",loginTitle:"账户密码登录",tabs:[{name:"刷卡登录",btnLabel:"请刷卡登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"},{name:"用户名登录",btnLabel:"登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"}]}),A=e.ref(""),i=e.ref(!1),f=e.ref(!1),C=()=>{i.value=!0},N=a=>{i.value=!1,R(a)},T=(a,o)=>{i.value=!1,a&&R(o)},w=a=>I.getFirstArrayProperty(a),V=a=>{let o;const n=I.convertArrayToTree(a),s=I.addPathToTree(n),g=I.getLeafNodesRecursive(s),h=I.groupByField(g,"parentPath");return o=I.handleRowAuthorityRender(h),o},U=(a,o)=>{var s,g,h;const n=(o==null?void 0:o.userRoles)??(o==null?void 0:o.角色名称);try{if(o.layer&&((s=o==null?void 0:o.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN")return"superAdmin";if(Array.isArray(n)){if((n==null?void 0:n.length)===1){const c=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===(n==null?void 0:n[0])||t.角色名称===(n==null?void 0:n[0])),_=w(c),l=V(c==null?void 0:c[_]);return c&&l&&Array.isArray(l)?c?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}if((n==null?void 0:n.length)>1){let c=a==null?void 0:a.filter(t=>n==null?void 0:n.includes(t.roleName||(t==null?void 0:t.角色名称)));const _=w(c==null?void 0:c[0]),l=(h=(g=c==null?void 0:c.map(t=>Array.isArray(t==null?void 0:t[_])?t==null?void 0:t[_]:[]))==null?void 0:g.flat())==null?void 0:h.flatMap(t=>t.checkedButtons);return(l==null?void 0:l.length)===0?m.ElMessage.error("该用户没有权限,请联系管理员"):new Set(l)}}if(typeof n=="string"){const c=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===n||(t==null?void 0:t.角色名称)===n),_=w(c),l=V(c==null?void 0:c[_]);return c&&l&&Array.isArray(l)?c?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}}catch(c){throw new Error(c)}},P=async a=>{var o,n;try{let s=[];const g=await m.getInsofDataApi({key:{systemKey:a==null?void 0:a.systemKey,pageKey:"系统管理/角色管理",type:"data"}});if(g.data.code===200){const h=(n=(o=g.data)==null?void 0:o.result)==null?void 0:n.map(c=>c.value.tableData);s=U(h,a)}if(s)return Array.isArray(s)?Array.from(s):s;throw m.ElMessage.error("获取用户权限失败,请联系管理员"),new Error("获取用户权限失败,请联系管理员")}catch(s){throw m.ElMessage.error("获取用户权限失败,请联系管理员"),new Error(s)}},L=async a=>{var o,n,s,g,h,c,_;try{let l=[],t,k,K;p.value?K={pageKey:"系统管理/用户管理",type:"data",systemKey:p.value}:K={pageKey:"系统管理/用户管理",type:"data"};const O=await m.getInsofDataApi({key:K}),J=await m.getInsofDataApi({key:{layer:"superAdmin"}});if(O.data.code===200&&J.data.code===200){const W=(n=(o=J.data)==null?void 0:o.result)==null?void 0:n.map(d=>{var S,M;return{...d.value.tableData,layer:(S=d.key)==null?void 0:S.layer,systemKey:(M=d==null?void 0:d.key)==null?void 0:M.systemKey,id:d.id}}),H=(g=(s=O.data)==null?void 0:s.result)==null?void 0:g.map(d=>{var S,M;return{...d.value.tableData,layer:(S=d.key)==null?void 0:S.layer,systemKey:(M=d==null?void 0:d.key)==null?void 0:M.systemKey,id:d.id}}),q=[...W,...H];if(t=q==null?void 0:q.find(d=>(d==null?void 0:d.account)===(a==null?void 0:a.account)||(d==null?void 0:d.账号)===(a==null?void 0:a.account)),t){if(((h=t.layer)==null?void 0:h.toUpperCase())!=="SUPERADMIN"&&(!(t!=null&&t.状态)||(t==null?void 0:t.状态)==="禁用"||(t==null?void 0:t.status)==="禁用")){m.ElMessage.error("该用户已被禁用,请联系管理员"),f.value=!1;return}l=await P(t);const{privateKey:d}=await r.getModelSecretAsync(t);let S;if(t.password?S=((c=t.layer)==null?void 0:c.toUpperCase())==="SUPERADMIN"?t.password:z.decryptData(t.password,d):S=((_=t.layer)==null?void 0:_.toUpperCase())==="SUPERADMIN"?t.password:I.resetPassword,(a==null?void 0:a.password)===S)k=t;else throw k=null,m.ElMessage.error("输入的密码错误,请重新输入"),f.value=!1,new Error("输入的密码错误,请重新输入")}}return k&&l?{matchedUser:k,userAuthority:l}:void 0}catch(l){throw new Error(l)}},D=async a=>{var n,s,g;const o=await L(a);if(o!=null&&o.matchedUser){r.setLoginUserInfo(o.matchedUser),sessionStorage.setItem("authority",JSON.stringify(o.userAuthority));const h=((s=(n=o.matchedUser)==null?void 0:n.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN";return sessionStorage.setItem("isSuperAdmin",JSON.stringify(h)),sessionStorage.setItem("systemKey",(g=o.matchedUser)==null?void 0:g.systemKey),await Q(o.matchedUser),!0}else throw f.value=!1,m.ElMessage.error("该用户不存在,请重新输入"),new Error("该用户不存在,请重新输入")},Q=async a=>{var n,s,g,h,c,_,l,t,k;const o=await m.getInsofDataApi({key:{layer:"superAdmin",systemKey:a==null?void 0:a.systemKey}});if(o.data.code===200&&(n=o.data)!=null&&n.result&&Array.isArray((s=o.data)==null?void 0:s.result)&&((h=(g=o.data)==null?void 0:g.result)==null?void 0:h.length)>0){const K=(k=(t=(l=(_=(c=o.data)==null?void 0:c.result)==null?void 0:_[0])==null?void 0:l.value)==null?void 0:t.tableData)==null?void 0:k.account;r.setSuperAdminInfo({account:K})}},Y=async()=>{var a,o,n;try{const s=await Ne();return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("loginToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){m.ElMessage.error(s)}},j=async()=>{var a,o,n;try{const s=await m.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("magicToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){m.ElMessage.error(s)}},R=a=>{f.value=!0;let o=[D(a),Y(),j()];Promise.all(o).then(n=>{(n==null?void 0:n.every(g=>g))&&(Ee(),y.push("/"),r.setLogRecordAsync({type:"登录",data:{account:a==null?void 0:a.account}},"/login","login"))})},F=a=>{A.value=a,i.value=!1,f.value=!1};return(a,o)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",ke,[e.createElementVNode("div",Ie,[e.createVNode(ne,{class:"login-left-bg"},{img:e.withCtx(()=>{var n,s;return[e.createElementVNode("div",xe,[e.createElementVNode("div",null,e.toDisplayString(((n=e.unref(b))==null?void 0:n.EnglishName)??"INSOFWORKS"),1),e.createElementVNode("div",null,e.toDisplayString(((s=e.unref(b))==null?void 0:s.EnglishName)??"工业软件集成开发平台"),1)]),o[0]||(o[0]=e.createElementVNode("div",{class:"divide-line"},null,-1))]}),_:1})]),e.createElementVNode("div",Te,[e.createVNode(ue,{loading:f.value,onClickLogin:C,onHandleTabClick:F},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.loginTitle),1)]),tabLabel1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[0].name),1)]),tabContent1:e.withCtx(()=>[e.createVNode(Ce,{activeTabName:A.value,onHandleCardInput:N},null,8,["activeTabName"])]),tabButton1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[0].btnLabel),1)]),tabLabel2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[1].name),1)]),tabContent2:e.withCtx(()=>[e.createVNode(ye,{activeTabName:A.value,isClickLogin:i.value,onHandleLoginFormChange:T},null,8,["activeTabName","isClickLogin"])]),tabButton2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[1].btnLabel),1)]),_:1},8,["loading"])])])]))}}),Ke=B._export_sfc(Ve,[["__scopeId","data-v-8e3a73d9"]]);exports.default=Ke;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),$=require("vue-router"),x=require("./login-D-3kbcCv.cjs"),m=require("./index-BKUqLOwQ.cjs"),z=require("./crypto-CRbcEKIz.cjs"),I=require("./index-xsqiMVT2.cjs"),ee={},te={class:"left-wrap"},ae={class:"left-bg"};function oe(v,E){return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",ae,[e.renderSlot(v.$slots,"img",{},void 0,!0)])])}const ne=B._export_sfc(ee,[["render",oe],["__scopeId","data-v-9b7ee6c9"]]),se={class:"right-wrap"},re={class:"right-title"},ce={class:"right-content"},le={class:"tab-content"},ie={class:"tab-tips"},de=e.defineComponent({__name:"index",props:{tabList:{type:Array,default:[]},loading:{type:Boolean,default:!1}},emits:["clickLogin","handleTabClick"],setup(v,{emit:E}){const y=e.ref("account"),r=E,p=()=>{r("clickLogin",y.value)},b=()=>{r("handleTabClick",y.value)};return(u,A)=>{const i=e.resolveComponent("el-button"),f=e.resolveComponent("el-tab-pane"),C=e.resolveComponent("el-tabs");return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",re,[e.renderSlot(u.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",ce,[e.createVNode(C,{modelValue:y.value,"onUpdate:modelValue":A[0]||(A[0]=N=>y.value=N),class:"right-tabs",onTabClick:b},{default:e.withCtx(()=>[e.createVNode(f,{name:"account"},{label:e.withCtx(()=>[e.renderSlot(u.$slots,"tabLabel2",{},void 0,!0)]),default:e.withCtx(()=>[e.createElementVNode("div",le,[e.renderSlot(u.$slots,"tabContent2",{},void 0,!0)]),e.createElementVNode("div",{class:"tab-button special",onClick:p},[e.createVNode(i,{loading:v.loading},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"tabButton2",{},void 0,!0)]),_:3},8,["loading"])]),e.createElementVNode("div",ie,[e.renderSlot(u.$slots,"tabTips2",{},void 0,!0)])]),_:3})]),_:3},8,["modelValue"])])])}}}),ue=B._export_sfc(de,[["__scopeId","data-v-3ebcb6e2"]]),pe={class:"account-wrap"},fe=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""},isClickLogin:{type:Boolean,default:!1}},emits:["handleLoginFormChange"],setup(v,{emit:E}){const y=v,r=e.reactive({account:"",password:""}),p=e.reactive({account:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}),b=e.ref(null),u=E;return e.watch(()=>y.isClickLogin,A=>{var i;A&&((i=b.value)==null||i.validate(f=>{u("handleLoginFormChange",f,f?r:null)}))},{immediate:!0}),e.watch(()=>y.activeTabName,A=>{var i;A&&((i=b.value)==null||i.resetFields())}),(A,i)=>{const f=e.resolveComponent("svg-icon"),C=e.resolveComponent("el-input"),N=e.resolveComponent("el-form-item"),T=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(T,{model:r,rules:p,ref_key:"formRef",ref:b},{default:e.withCtx(()=>[e.createVNode(N,{label:"",prop:"account"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:r.account,"onUpdate:modelValue":i[0]||(i[0]=w=>r.account=w),placeholder:"请输入账号",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(f,{name:"account",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(N,{label:"",prop:"password"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:r.password,"onUpdate:modelValue":i[1]||(i[1]=w=>r.password=w),type:"password",placeholder:"请输入密码","show-password":"",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(f,{name:"password",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])}}}),ye=B._export_sfc(fe,[["__scopeId","data-v-b023e8c1"]]),ge="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAAXNSR0IArs4c6QAAAd9JREFUWEftl71OAkEQx/97QC8XEj+iiTGexo/OnvgE0ChPIIXHQwgP4amxsYZGnkCtpbAxxiyJFEqCJie1yK7ZixhUuNtZYkLUa2/+M7+ZnbnbYTB87P3bIpi1BWCt34UEzpkUF35huWjimpmIlCbp8TMGbA7RX/uus27i2xjI9rgMC+i7jpFvI5EC+XEg2+NlSKTBMKmTuS5QlB2ApgRqz66TVXGDCmmIPhh7RxGl0bXrT15pWNLjVQZkdBuwF0i3qaPAv8StMNvjDwBmdIGQwJyfd+51xn7i4GbekvE7bd8SLQUUOi3fnElR0v3GvEPvaQOpHiIDKe9SlIQlTtq7K41BwexjPosXsQNmkWCCpjYCoqRMtP0HiirY76uQBWQRS1xalhCvnW4aQDmqCmHvR6rQsB/oKIMyClDOd53KoGxTHs8IoGpSKWOgeCI29ZhfaA0EOmpMi26n+beBAIzXkanjGLemDlpkrMbepGmjNMZTFuXY9D0dSF09wE7bhaWrsKD2IV+FgNrNtilwVKCK7zo5SgDqJY0EFJPMeSos1ilAKa++ISBruhoSUNi3Z1hA2+PqyLR/uPRLvm6qJnbqkk9dg0ziEDQV8qJIcE42DRbFnkp3lSZHiRZ8WqXfAFwe+He0YFLSAAAAAElFTkSuQmCC",me="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYA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34XKc29j+AXyzojCfNKqJAAAAAElFTkSuQmCC",Ae={class:"card-wrap"},he={class:"card-icon card"},be={class:"card-input"},ve={class:"card-icon info"},_e=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""}},emits:["handleCardInput"],setup(v,{emit:E}){const y=v,r=e.ref(""),p=E,b=u=>{p("handleCardInput",u)};return e.watch(()=>y.activeTabName,u=>{u&&(r.value="")}),(u,A)=>{const i=e.resolveComponent("el-image"),f=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",he,[e.createVNode(i,{src:e.unref(ge),fit:"contain"},null,8,["src"])]),e.createElementVNode("div",be,[e.createVNode(f,{modelValue:r.value,"onUpdate:modelValue":A[0]||(A[0]=C=>r.value=C),onChange:b,clearable:""},null,8,["modelValue"])]),e.createElementVNode("div",ve,[e.createVNode(i,{src:e.unref(me),fit:"contain"},null,8,["src"])])])}}}),Ce=B._export_sfc(_e,[["__scopeId","data-v-23f91251"]]),we=x.useMenuState(x.pinia),X=x.useLoginState(x.pinia),G=e.ref(!1),Z=e.ref(!1),Ee=async()=>{const v=m.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),E=m.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}});return await Promise.all([v,E]).then(y=>{var b,u,A,i,f,C,N,T,w,V,U,P,L,D;const r=y==null?void 0:y[0],p=y==null?void 0:y[1];if(r.data.code===200){const Q=(N=(C=(f=(i=(A=(u=(b=r==null?void 0:r.data)==null?void 0:b.result)==null?void 0:u[0])==null?void 0:A.value)==null?void 0:i.pageData)==null?void 0:f.compData)==null?void 0:C[0])==null?void 0:N.contents;we.setRawMenus(Q??[]),G.value=((T=r==null?void 0:r.data)==null?void 0:T.result)&&((V=(w=r==null?void 0:r.data)==null?void 0:w.result)==null?void 0:V.length)>0}else m.ElMessage.error("获取模型菜单响应失败");p.data.code===200?p.data.result&&((U=p.data.result)==null?void 0:U.length)>0&&(X.setStructureData(p.data.result),X.setIsStructureExist(!0),Z.value=((P=p==null?void 0:p.data)==null?void 0:P.result)&&((D=(L=p==null?void 0:p.data)==null?void 0:L.result)==null?void 0:D.length)>0):m.ElMessage.error("获取模型结构响应失败")}),{menuExist:G.value,structureExist:Z.value}};function Ne(){const v={account:"superadmin",password:"1c8e7623312244c1feb677732278fb8b2af6af1a5335fdaebbdb2720137b372b7871292d11165b83b2967b9c39fa37027d63d37a2f36d764257b566dcfa99f334faa8995301601aec549adf39aef8d89c8788da03a9164937a5f73af20a15ea60d47c7cf01cf",tenantId:-1,code:"",codeId:0};return m.service({url:"/api/sysAuth/login",method:"post",data:v})}const Se={class:"login-wrap"},ke={class:"login-body"},Ie={class:"login-body-item left"},xe={class:"title"},Te={class:"login-body-item right"},Ve=e.defineComponent({__name:"index",emits:["change"],setup(v,{emit:E}){const y=$.useRouter(),r=x.useLoginState(x.pinia),{systemKey:p,systemInfo:b}=x.storeToRefs(r),u=e.ref({sysCTitle:"",sysETitle:"",loginTitle:"账户密码登录",tabs:[{name:"刷卡登录",btnLabel:"请刷卡登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"},{name:"用户名登录",btnLabel:"登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"}]}),A=e.ref(""),i=e.ref(!1),f=e.ref(!1),C=()=>{i.value=!0},N=a=>{i.value=!1,R(a)},T=(a,o)=>{i.value=!1,a&&R(o)},w=a=>I.getFirstArrayProperty(a),V=a=>{let o;const n=I.convertArrayToTree(a),s=I.addPathToTree(n),g=I.getLeafNodesRecursive(s),h=I.groupByField(g,"parentPath");return o=I.handleRowAuthorityRender(h),o},U=(a,o)=>{var s,g,h;const n=(o==null?void 0:o.userRoles)??(o==null?void 0:o.角色名称);try{if(o.layer&&((s=o==null?void 0:o.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN")return"superAdmin";if(Array.isArray(n)){if((n==null?void 0:n.length)===1){const c=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===(n==null?void 0:n[0])||t.角色名称===(n==null?void 0:n[0])),_=w(c),l=V(c==null?void 0:c[_]);return c&&l&&Array.isArray(l)?c?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}if((n==null?void 0:n.length)>1){let c=a==null?void 0:a.filter(t=>n==null?void 0:n.includes(t.roleName||(t==null?void 0:t.角色名称)));const _=w(c==null?void 0:c[0]),l=(h=(g=c==null?void 0:c.map(t=>Array.isArray(t==null?void 0:t[_])?t==null?void 0:t[_]:[]))==null?void 0:g.flat())==null?void 0:h.flatMap(t=>t.checkedButtons);return(l==null?void 0:l.length)===0?m.ElMessage.error("该用户没有权限,请联系管理员"):new Set(l)}}if(typeof n=="string"){const c=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===n||(t==null?void 0:t.角色名称)===n),_=w(c),l=V(c==null?void 0:c[_]);return c&&l&&Array.isArray(l)?c?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}}catch(c){throw new Error(c)}},P=async a=>{var o,n;try{let s=[];const g=await m.getInsofDataApi({key:{systemKey:a==null?void 0:a.systemKey,pageKey:"系统管理/角色管理",type:"data"}});if(g.data.code===200){const h=(n=(o=g.data)==null?void 0:o.result)==null?void 0:n.map(c=>c.value.tableData);s=U(h,a)}if(s)return Array.isArray(s)?Array.from(s):s;throw m.ElMessage.error("获取用户权限失败,请联系管理员"),new Error("获取用户权限失败,请联系管理员")}catch(s){throw m.ElMessage.error("获取用户权限失败,请联系管理员"),new Error(s)}},L=async a=>{var o,n,s,g,h,c,_;try{let l=[],t,k,K;p.value?K={pageKey:"系统管理/用户管理",type:"data",systemKey:p.value}:K={pageKey:"系统管理/用户管理",type:"data"};const O=await m.getInsofDataApi({key:K}),J=await m.getInsofDataApi({key:{layer:"superAdmin"}});if(O.data.code===200&&J.data.code===200){const W=(n=(o=J.data)==null?void 0:o.result)==null?void 0:n.map(d=>{var S,M;return{...d.value.tableData,layer:(S=d.key)==null?void 0:S.layer,systemKey:(M=d==null?void 0:d.key)==null?void 0:M.systemKey,id:d.id}}),H=(g=(s=O.data)==null?void 0:s.result)==null?void 0:g.map(d=>{var S,M;return{...d.value.tableData,layer:(S=d.key)==null?void 0:S.layer,systemKey:(M=d==null?void 0:d.key)==null?void 0:M.systemKey,id:d.id}}),q=[...W,...H];if(t=q==null?void 0:q.find(d=>(d==null?void 0:d.account)===(a==null?void 0:a.account)||(d==null?void 0:d.账号)===(a==null?void 0:a.account)),t){if(((h=t.layer)==null?void 0:h.toUpperCase())!=="SUPERADMIN"&&(!(t!=null&&t.状态)||(t==null?void 0:t.状态)==="禁用"||(t==null?void 0:t.status)==="禁用")){m.ElMessage.error("该用户已被禁用,请联系管理员"),f.value=!1;return}l=await P(t);const{privateKey:d}=await r.getModelSecretAsync(t);let S;if(t.password?S=((c=t.layer)==null?void 0:c.toUpperCase())==="SUPERADMIN"?t.password:z.decryptData(t.password,d):S=((_=t.layer)==null?void 0:_.toUpperCase())==="SUPERADMIN"?t.password:I.resetPassword,(a==null?void 0:a.password)===S)k=t;else throw k=null,m.ElMessage.error("输入的密码错误,请重新输入"),f.value=!1,new Error("输入的密码错误,请重新输入")}}return k&&l?{matchedUser:k,userAuthority:l}:void 0}catch(l){throw new Error(l)}},D=async a=>{var n,s,g;const o=await L(a);if(o!=null&&o.matchedUser){r.setLoginUserInfo(o.matchedUser),sessionStorage.setItem("authority",JSON.stringify(o.userAuthority));const h=((s=(n=o.matchedUser)==null?void 0:n.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN";return sessionStorage.setItem("isSuperAdmin",JSON.stringify(h)),sessionStorage.setItem("systemKey",(g=o.matchedUser)==null?void 0:g.systemKey),await Q(o.matchedUser),!0}else throw f.value=!1,m.ElMessage.error("该用户不存在,请重新输入"),new Error("该用户不存在,请重新输入")},Q=async a=>{var n,s,g,h,c,_,l,t,k;const o=await m.getInsofDataApi({key:{layer:"superAdmin",systemKey:a==null?void 0:a.systemKey}});if(o.data.code===200&&(n=o.data)!=null&&n.result&&Array.isArray((s=o.data)==null?void 0:s.result)&&((h=(g=o.data)==null?void 0:g.result)==null?void 0:h.length)>0){const K=(k=(t=(l=(_=(c=o.data)==null?void 0:c.result)==null?void 0:_[0])==null?void 0:l.value)==null?void 0:t.tableData)==null?void 0:k.account;r.setSuperAdminInfo({account:K})}},Y=async()=>{var a,o,n;try{const s=await Ne();return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("loginToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){m.ElMessage.error(s)}},j=async()=>{var a,o,n;try{const s=await m.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("magicToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){m.ElMessage.error(s)}},R=a=>{f.value=!0;let o=[D(a),Y(),j()];Promise.all(o).then(n=>{(n==null?void 0:n.every(g=>g))&&(Ee(),y.push("/"),r.setLogRecordAsync({type:"登录",data:{account:a==null?void 0:a.account}},"/login","login"))})},F=a=>{A.value=a,i.value=!1,f.value=!1};return(a,o)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",ke,[e.createElementVNode("div",Ie,[e.createVNode(ne,{class:"login-left-bg"},{img:e.withCtx(()=>{var n,s;return[e.createElementVNode("div",xe,[e.createElementVNode("div",null,e.toDisplayString(((n=e.unref(b))==null?void 0:n.EnglishName)??"INSOFWORKS"),1),e.createElementVNode("div",null,e.toDisplayString(((s=e.unref(b))==null?void 0:s.chineseName)??"工业软件集成开发平台"),1)]),o[0]||(o[0]=e.createElementVNode("div",{class:"divide-line"},null,-1))]}),_:1})]),e.createElementVNode("div",Te,[e.createVNode(ue,{loading:f.value,onClickLogin:C,onHandleTabClick:F},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.loginTitle),1)]),tabLabel1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[0].name),1)]),tabContent1:e.withCtx(()=>[e.createVNode(Ce,{activeTabName:A.value,onHandleCardInput:N},null,8,["activeTabName"])]),tabButton1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[0].btnLabel),1)]),tabLabel2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[1].name),1)]),tabContent2:e.withCtx(()=>[e.createVNode(ye,{activeTabName:A.value,isClickLogin:i.value,onHandleLoginFormChange:T},null,8,["activeTabName","isClickLogin"])]),tabButton2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value.tabs[1].btnLabel),1)]),_:1},8,["loading"])])])]))}}),Ke=B._export_sfc(Ve,[["__scopeId","data-v-487592d7"]]);exports.default=Ke;
|
|
@@ -463,7 +463,7 @@ const ze = { class: "login-wrap" }, He = { class: "login-body" }, $e = { class:
|
|
|
463
463
|
return [
|
|
464
464
|
m("div", et, [
|
|
465
465
|
m("div", null, x(((s = Y(v)) == null ? void 0 : s.EnglishName) ?? "INSOFWORKS"), 1),
|
|
466
|
-
m("div", null, x(((n = Y(v)) == null ? void 0 : n.
|
|
466
|
+
m("div", null, x(((n = Y(v)) == null ? void 0 : n.chineseName) ?? "工业软件集成开发平台"), 1)
|
|
467
467
|
]),
|
|
468
468
|
a[0] || (a[0] = m("div", { class: "divide-line" }, null, -1))
|
|
469
469
|
];
|
|
@@ -511,7 +511,7 @@ const ze = { class: "login-wrap" }, He = { class: "login-body" }, $e = { class:
|
|
|
511
511
|
])
|
|
512
512
|
]));
|
|
513
513
|
}
|
|
514
|
-
}), dt = /* @__PURE__ */ V(at, [["__scopeId", "data-v-
|
|
514
|
+
}), dt = /* @__PURE__ */ V(at, [["__scopeId", "data-v-487592d7"]]);
|
|
515
515
|
export {
|
|
516
516
|
dt as default
|
|
517
517
|
};
|