app.bb4ed606.js 48 KB

12
  1. (function(){var e={191:function(e,t,a){"use strict";a.d(t,{i:function(){return o}});a(1454);var s=a(4642);const o={baseUrl:`${s.baseApi}onlinePost`,ajaxstart:{functionName:"select_user_type1",r_type:null,page:null,num:null},userstate:{functionName:"update_user_state"},ajax_admin:{functionName:"update_user_admin"},ajax_school:{functionName:"select_school_name",u_name:"",u_org:""},ajax_org:{functionName:"select_organization"},ajax_school_name:{functionName:"select_school_name"},ajax_add_school:{functionName:"insert_school"},ajax_add_org:{functionName:"insert_org"},ajax_confirm:{functionName:"updata_user_o_s"},pending:{functionName:"select_requestuser",r_type:0,page:1,r_num:100},approved:{functionName:"select_requestuser",r_type:1,page:1,r_num:100},refused:{functionName:"select_requestuser",r_type:2,page:1,r_num:100},moveToApproved:{functionName:"account_approve_user",successMessage:"数据已成功移动到已通过状态!"},moveToRejected:{functionName:"account_reject_user",successMessage:"数据已成功移动到已拒绝状态!"},moveToPending:{functionName:"account_move_to_pending",successMessage:"数据已成功移动到待审核状态!"},allRecords:{functionName:"select_requestuser",r_types:[0,1,2],page:1,r_num:100,processData(e){const[t,a,s]=e,o=[...t.data[0],...a.data[0],...s.data[0]];return o.map((e=>{const t=void 0!==e.type&&null!==e.type?e.type:0;return{company:e.schoolName||"未知",phone:e.contact_info||"未知",name:e.name||"未知",submission_time:e.create_at||"未知",remarks:e.remark||"未知",Pending_time:e.active_at||"未知",status:t,userid:e.id||"未知"}}))}}}},3080:function(e){e.exports={env:"production",title:"cocorobo",baseUrl:"https://www.xxx.com/",baseApi:"https://pbl.cocorobo.cn/api/pbl/",APPID:"xxx",APPSECRET:"xxx",$cdn:"https://imgs.solui.cn"}},4642:function(e,t,a){const s=a(3080);e.exports=s},9754:function(e,t,a){"use strict";var s=a(6848),o=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("router-view")],1)},n=[],i=a(1656),r={},l=(0,i.A)(r,o,n,!1,null,null,null),c=l.exports,u=a(6178),d=function(){var e=this,t=e._self._c;return t("div",{staticClass:"body"},[t("div",{staticClass:"top"},[t("div",{staticClass:"title"},[e._v("CocoClass后台管理")]),t("div",{staticClass:"person"},[t("div",{staticClass:"person_name"},[e._v(e._s(e.userinfo?e.userinfo.username:""))])])]),t("div",{staticClass:"container"},[t("div",{staticClass:"left"},[t("ul",[t("router-link",{staticClass:"menu_left",attrs:{to:"/user-list"}},[t("i",{staticClass:"el-icon-s-custom"}),e._v("账号列表")]),t("router-link",{staticClass:"menu_left",attrs:{to:"/user-examine"}},[t("i",{staticClass:"el-icon-edit"}),e._v("账号审核")])],1)]),t("div",{staticClass:"table-container"},[t("router-view")],1)])])},p=[],h=a(3518),m={name:"HomeView",computed:{...(0,h.L8)(["userinfo"])},data(){return{}},mounted(){}},_=m,g=(0,i.A)(_,d,p,!1,null,"49bdedc0",null),f=g.exports,b=function(){var e=this,t=e._self._c;return t("div",{staticClass:"list_container"},[t("div",{staticClass:"title_examine"},[t("div",{staticClass:"pub_title"},[e._v("账号列表")]),t("div",{staticStyle:{"margin-left":"auto"}},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.nextStep()}}},[e._v("新增账户")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"移动选择",visible:e.isOrgFormVisible,"before-close":e.close_table,width:"920px"},on:{"update:visible":function(t){e.isOrgFormVisible=t}}},[t("div",{staticClass:"input-container"},[t("div",{staticClass:"input_box"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchQuery,expression:"searchQuery"}],staticClass:"table_find",attrs:{type:"text",placeholder:"搜索学校"},domProps:{value:e.searchQuery},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.ajax_school_name(e.searchQuery,e.school.type)},input:function(t){t.target.composing||(e.searchQuery=t.target.value)}}}),t("i",{staticClass:"el-icon-search",on:{click:function(t){return e.ajax_school_name(e.searchQuery,e.school.type)}}})]),t("el-select",{staticClass:"custom-select",staticStyle:{"margin-left":"10px"},attrs:{placeholder:"请选择组织",clearable:""},on:{change:e.ajax_org_check},model:{value:e.school.OrgId,callback:function(t){e.$set(e.school,"OrgId",t)},expression:"school.OrgId"}},e._l(e.organizations,(function(a,s){return t("el-option",{key:s,attrs:{label:a.name,value:a.id}},[e._v(" "+e._s(a.name)+" ")])})),1)],1),t("div",{staticClass:"table_down"},[e.cn_org?t("div",[t("div",{staticClass:"checkbox-container"},e._l(e.cn_school,(function(a,s){return t("div",{key:s,staticClass:"checkbox_comment"},[t("div",{staticClass:"checkbox-left"},[t("label",{staticClass:"checkbox-label"},[t("a",[e._v(e._s(a.name))])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.selectedSchool,expression:"selectedSchool"}],staticClass:"checkbox_input_org",attrs:{type:"radio",name:"school_selection"},domProps:{value:a.name,checked:e._q(e.selectedSchool,a.name)},on:{change:function(t){e.selectedSchool=a.name}}})])])})),0)]):e._e()]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.isOrgFormVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.add_school_dialog=!0}}},[e._v("新增学校")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.add_org_dialog=!0}}},[e._v("新增组织")]),t("el-button",{attrs:{type:"primary"},on:{click:e.ajax_confirm}},[e._v("确认移动")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"新增账户",visible:e.isTableUseVisible,"before-close":e.close_table,width:"700px"},on:{"update:visible":function(t){e.isTableUseVisible=t}}},[t("div",{staticClass:"el-dialog__body"},[t("form",{staticClass:"el-form",attrs:{"data-v-3a331e10":""}},[t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学生姓名")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",{attrs:{"data-v-3a331e10":""}},[t("div",{staticClass:"add_input el-input el-input--suffix",attrs:{"data-v-3a331e10":""}},[t("input",{staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入学生姓名"}})])])])]),t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学生姓名")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",{attrs:{"data-v-3a331e10":""}},[t("div",{staticClass:"add_input el-input el-input--suffix",attrs:{"data-v-3a331e10":""}},[t("input",{staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入学生姓名"}})])])])]),t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("选择组织")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("el-select",{staticClass:"custom-select",attrs:{placeholder:"请选择组织"},model:{value:e.school.type,callback:function(t){e.$set(e.school,"type",t)},expression:"school.type"}},[t("el-option",{attrs:{value:1}},[e._v("组织1")]),t("el-option",{attrs:{value:2}},[e._v("组织2")])],1)],1)]),t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("选择学校")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("el-select",{staticClass:"custom-select",attrs:{placeholder:"请选择"},model:{value:e.school.type,callback:function(t){e.$set(e.school,"type",t)},expression:"school.type"}},[t("el-option",{attrs:{value:1}},[e._v("学校1")]),t("el-option",{attrs:{value:2}},[e._v("学校2")])],1)],1)])])]),t("div",{staticClass:"el-dialog__footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.isTableUseVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"}},[e._v("确认")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"新增学校",visible:e.add_school_dialog,"before-close":e.close_add_school,width:"700px"},on:{"update:visible":function(t){e.add_school_dialog=t}}},[t("div",{staticClass:"el_dialog_school_content"},[t("form",{staticClass:"el-form"},[t("div",{staticClass:"el-form-item",staticStyle:{"margin-top":"15px"}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学校名称")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.sch_name,expression:"sch_name"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"学校名称"},domProps:{value:e.sch_name},on:{input:function(t){t.target.composing||(e.sch_name=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("地区")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.region,expression:"region"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入地区"},domProps:{value:e.region},on:{input:function(t){t.target.composing||(e.region=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学校编码")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.schoolCode,expression:"schoolCode"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入编码"},domProps:{value:e.schoolCode},on:{input:function(t){t.target.composing||(e.schoolCode=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("上级组织")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"100px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("el-form",{ref:"form",staticStyle:{float:"left","margin-left":"20px",width:"200px",height:"30px","margin-top":"-65px"},attrs:{model:e.school}},[t("el-select",{staticClass:"custom-select",attrs:{placeholder:"请选择组织"},model:{value:e.school.parentOrgId,callback:function(t){e.$set(e.school,"parentOrgId",t)},expression:"school.parentOrgId"}},e._l(e.organizations,(function(a,s){return t("el-option",{key:s,attrs:{label:a.name,value:a.id}},[e._v(" "+e._s(a.name)+" ")])})),1)],1)],1)])])])])]),t("div",{staticClass:"el-dialog__footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.add_school_dialog=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.ajax_add_school}},[e._v("确认")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"新增组织",visible:e.add_org_dialog,"before-close":e.close_add_org,width:"700px"},on:{"update:visible":function(t){e.add_org_dialog=t}}},[t("div",{staticClass:"el_dialog_org_content"},[t("form",{staticClass:"el-form"},[t("div",{staticClass:"el-form-item",staticStyle:{"margin-top":"15px"}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("组织名称")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.orgName,expression:"orgName"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"组织名称"},domProps:{value:e.orgName},on:{input:function(t){t.target.composing||(e.orgName=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("随机码")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.randomCode,expression:"randomCode"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入随机码"},domProps:{value:e.randomCode},on:{input:function(t){t.target.composing||(e.randomCode=t.target.value)}}})])])])])])]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.add_org_dialog=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.ajax_add_org}},[e._v("确认")])],1)]),t("div",{staticClass:"content"},[t("div",{staticClass:"button_top"},[t("a",{style:{color:e.open?"black":"rgb(179, 179, 179)"},on:{click:e.showopen}},[e._v("启用中("+e._s(e.tableData.length)+")")]),t("a",{style:{color:e.stop?"black":"rgb(179, 179, 179)"},on:{click:e.showstop}},[e._v("已停用("+e._s(e.tableData_stop.length)+")")])]),e.open_content?t("div",[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.paginatedData,border:"",stripe:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_name",label:"组织名称","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_number",label:"学校名称","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",label:"姓名","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"account",label:"账户","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"身份","min-width":"32","header-align":"center",align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("div",[e._v(e._s(e.roleType(a)))])]}}],null,!1,3854193392)}),t("el-table-column",{attrs:{"show-overflow-toolti":"",label:"操作","min-width":"35","header-align":"center",align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.ajax__open_stop(a.userid)}}},[e._v("停用")]),t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.run(a.userid)}}},[e._v("移动")]),1===a.type?t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.ajax_admin(a.userid,a.role,a.type)}}},[e._v(" "+e._s(1===a.role?"已设置管理员":"设置管理员")+" ")]):e._e()]}}],null,!1,1327522867)})],1),e.up_page?t("div",{staticClass:"Pagetion"},[t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,total:e.tableData.length,layout:"total, prev, pager, next, jumper"},on:{"current-change":e.handlePageChange}})],1):e._e()],1):e._e(),e.stop_content?t("div",[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.down_paginatedData,border:"","header-align":"center",align:"center",stripe:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_name",label:"组织名称","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_number",label:"学校名称","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",label:"姓名","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"account",label:"账户","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{label:"操作","min-width":"25","header-align":"center",align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.ajax__open_stop(a.userid)}}},[e._v("启用")])]}}],null,!1,3088615389)})],1),e.down_page?t("div",{staticClass:"Pagetion"},[t("el-pagination",{attrs:{"current-page":e.down_currentPage,"page-size":e.down_pageSize,total:e.tableData_stop.length,layout:"total, prev, pager, next, jumper"},on:{"current-change":e.down_handlePageChange}})],1):e._e()],1):e._e()])],1)},v=[],y=(a(8992),a(2577),a(1454),a(191)),x={name:"HelloWorld",components:{},data(){return{dropdownVisible:!1,checked:!0,showCompany:!1,isOrgFormVisible:!1,isTableUseVisible:!1,add_org_dialog:!1,orgName:"",u_create:"",randomCode:"",uLogin:"1",radio:"1",sch_name:"",region:"",schoolType:"1",schoolCode:"",loginPermission:"1",add_school_dialog:!1,isCompanyDropdownVisible:!1,companyListVisibility:[!1,!1,!1],open_content:!0,add_button:!0,stop_content:!1,open:!0,stop:!1,selectedSchool:"",currentPage:1,pageSize:10,down_currentPage:1,down_pageSize:10,up_page:!0,down_page:!1,company_name:0,tableData:[],tableData_stop:[],form:{name:"",account:"",organization:"",school:""},cn_org:!0,hk_org:!1,com_org:!1,organizations:[],cn_school:[],searchQuery:"",dialogVisible:!0,school:{OrgId:null},ajaxParams:null,check_user_id:""}},computed:{paginatedData(){const e=(this.currentPage-1)*this.pageSize,t=this.currentPage*this.pageSize;return this.tableData.slice(e,t)},down_paginatedData(){const e=(this.down_currentPage-1)*this.down_pageSize,t=this.down_currentPage*this.down_pageSize;return this.tableData_stop.slice(e,t)},roleType(){return function(e){return 2==e.type?"学生":1==e.type?1==e.role?"管理员":"老师":void 0}}},watch:{currentPage(e,t){e!==t&&this.ajax_user_open(e)},down_currentPage(e,t){e!==t&&this.ajax_user_stop(e)}},methods:{run(e){this.check_user_id=e,this.isOrgFormVisible=!0},close_table(){this.isOrgFormVisible=!1,this.isTableUseVisible=!1},nextStep(){this.isTableUseVisible=!0},form_clost(){this.isTableUseVisible=!1},close_add_org(){this.add_org_dialog=!1},close_add_school(){this.add_school_dialog=!1},showopen(){this.open_content=!0,this.add_button=!0,this.stop_content=!1,this.open=!0,this.stop=!1,this.up_page=!0,this.down_page=!1},showstop(){this.open_content=!1,this.add_button=!1,this.stop_content=!0,this.open=!1,this.stop=!0,this.up_page=!1,this.down_page=!0},handlePageChange(e){this.currentPage=e},down_handlePageChange(e){this.down_currentPage=e},cn_orgization(){this.cn_org=!0,this.hk_org=!1,this.com_org=!1},hk_orgization(){this.cn_org=!1,this.hk_org=!0,this.com_org=!1},com_orgization(){this.cn_org=!1,this.hk_org=!1,this.com_org=!0},headerCellStyle(){return{backgroundColor:"#f1f1f1"}},ajax_user_open(){let e=[{functionName:y.i.ajaxstart.functionName,r_type:1,page:this.currentPage,num:this.pageSize}];this.$ajax.post(y.i.baseUrl,e).then((e=>{const t=e.data[0].map((e=>({company_name:e.org_name||"暂无",company_number:e.school_name||"暂无",name:e.user_name||"暂无",account:e.account_name||"暂无",userid:e.user_id,role:e.admin_role||0,school:e.s_id,type:e.usertype})));this.tableData=Array(this.pageSize*(this.currentPage-1)).fill(null).concat(t);const a=e.data[0][0].total_count;this.tableData.length=a})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_user_stop(){let e=[{functionName:y.i.ajaxstart.functionName,r_type:0,page:this.down_currentPage,num:this.down_pageSize}];this.$ajax.post(y.i.baseUrl,e).then((e=>{const t=e.data[0].map((e=>({company_name:e.org_name||"暂无",company_number:e.school_name||"暂无",name:e.user_name||"暂无",account:e.account_name||"暂无",userid:e.user_id})));this.tableData_stop=Array(this.down_pageSize*(this.down_currentPage-1)).fill(null).concat(t);const a=e.data[0][0].total_count;this.tableData_stop.length=a})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax__open_stop(e){const t=this.open_content,a=t?"停用该条数据":"启用该条数据",s=t?"停用成功!":"启用成功!",o=t?"已取消停用":"已取消启用";let n=[{functionName:y.i.userstate.functionName,u_id:e}];this.$confirm(`此操作将会${a}, 是否继续?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$ajax.post(y.i.baseUrl,n).then((()=>{this.$message({type:"success",message:s}),this.ajax_user_stop(),this.ajax_user_open()})).catch((e=>{this.$message.error("处理失败"),console.error("请求失败,错误信息:",e)}))})).catch((()=>{this.$message({type:"info",message:o})}))},ajax_admin(e,t){let a=1===t?"此操作将会取消此用户的管理员状态,是否继续?":"此操作将会设置该用户为管理员,是否继续?";this.$confirm(a,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{let t=[{functionName:y.i.ajax_admin.functionName,u_id:e}];this.$ajax.post(y.i.baseUrl,t).then((e=>{this.tableData=e.data[0].map((e=>({company_name:e.name||"暂无",company_number:e.id||"暂无",name:e.username||"暂无",account:e.account||"暂无",role:e.role,userid:e.userid}))),this.ajax_user_stop(),this.ajax_user_open(),this.$message({type:"success",message:"已成功执行!"})})).catch((e=>{console.error("请求失败:",e),this.$message({type:"error",message:"操作失败,请稍后再试"})}))})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))},ajax_school(){const e=[y.i.ajax_school];this.$ajax.post(y.i.baseUrl,e).then((e=>{e.data&&Array.isArray(e.data[0])&&(this.cn_school=e.data[0].map((e=>({name:e.name,id:e.id}))))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_org(){const e=[y.i.ajax_org];this.$ajax.post(y.i.baseUrl,e).then((e=>{e.data&&Array.isArray(e.data[0])&&(this.organizations=e.data[0].map((e=>({name:e.name,id:e.id}))))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_school_name(e){const t=this.school.OrgId||"";if(!e)return void this.$message.warning("请输入搜索内容");let a=[{functionName:y.i.ajax_school_name.functionName,u_name:e,u_org:t}];this.$ajax.post(y.i.baseUrl,a).then((e=>{e.data&&Array.isArray(e.data[0])&&e.data[0].length>0?(this.cn_school=e.data[0].map((e=>({name:e.name,id:e.id}))),this.$message.success("成功查询到了学校")):this.$message.warning("没有找到匹配的学校"),this.$nextTick((()=>{this.searchQuery="",this.selectedSchool="",this.searchQuery=""}))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_org_check(){const e=this.school.OrgId||"";let t=[{functionName:y.i.ajax_school_name.functionName,u_name:"",u_org:e}];this.$ajax.post(y.i.baseUrl,t).then((e=>{e.data&&Array.isArray(e.data[0])&&e.data[0].length>0?(this.cn_school=e.data[0].map((e=>({name:e.name,id:e.id}))),this.$message.success("成功查询到了学校")):this.$message.warning("没有找到匹配的学校"),this.$nextTick((()=>{this.searchQuery="",this.selectedSchool=""}))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_add_school(){if(!this.sch_name||""===this.sch_name.trim())return void this.$message.error("学校名称不能为空!");let e=[{functionName:y.i.ajax_add_school.functionName,u_name:this.sch_name,u_org:this.school.parentOrgId||"",u_dest:this.region||"",u_type:this.schoolType||"",u_code:this.schoolCode||"",u_isLogin:"1"===this.loginPermission?1:2}];this.$ajax.post(y.i.baseUrl,e).then((()=>{this.$message({type:"success",message:"已成功执行!"}),this.ajax_school(),this.add_school_dialog=!1,this.sch_name="",this.school.parentOrgId="",this.region="",this.schoolType="1",this.schoolCode="",this.loginPermission="1"})).catch((e=>{this.$message.error("插入失败"),console.error("请求失败,错误信息:",e)}))},ajax_add_org(){let e=this.orgName,t=this.randomCode||"",a=this.radio;if(!e)return void this.$message.error("组织名称不能为空");let s=[{functionName:y.i.ajax_add_org.functionName,u_name:e,u_create:"0",u_code:t,u_login:a}];this.$ajax.post(y.i.baseUrl,s).then((()=>{this.$message({type:"success",message:"已成功执行!"}),this.ajax_org(),this.add_org_dialog=!1,this.orgName="",this.randomCode="",this.uLogin="1"})).catch((e=>{this.$message.error("插入失败"),console.error("请求失败,错误信息:",e)}))},ajax_confirm(){const e=this.school.OrgId||"",t=this.cn_school.find((e=>e.name===this.selectedSchool));if(!t||!t.id)return void this.$message({type:"warning",message:"请选择你要移动的学校!"});let a=[{functionName:y.i.ajax_confirm.functionName,u_id:this.check_user_id,o_id:e||"",s_id:t.id}];this.$ajax.post(y.i.baseUrl,a).then((()=>{this.$message({type:"success",message:"移动成功!"}),this.isOrgFormVisible=!1,this.ajax_user_open(),this.school.OrgId="",this.selectedSchool=null,this.ajax_school()})).catch((e=>{this.$message.error("移动失败"),console.error("请求失败,错误信息:",e)}))}},mounted(){this.ajax_user_stop(),this.ajax_user_open(),this.ajax_org(),this.ajax_school()}},w=x,C=(0,i.A)(w,b,v,!1,null,"0fd4cf7f",null),S=C.exports,k=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table_container"},[e._m(0),t("div",{staticClass:"table_content"},[t("div",{staticClass:"button_top"},[t("div",{staticClass:"examine_title"},[t("a",{style:{color:e.isPending?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:e.showPending}},[e._v("待审核("+e._s(e.tableData.length)+")")])]),t("div",{staticClass:"examine_title"},[t("a",{style:{color:e.isApproved?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:e.showApproved}},[e._v("已通过("+e._s(e.approvedData.length)+")")])]),t("div",{staticClass:"examine_title"},[t("a",{style:{color:e.isRefused?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:e.showRefused}},[e._v("已拒绝("+e._s(e.RefusedData.length)+")")])]),t("div",{staticClass:"examine_title"},[t("a",{style:{color:e.isAll?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:e.showAll}},[e._v("全部记录("+e._s(e.AllData.length)+")")])])]),t("div",{staticClass:"content"},[e.isPending?t("div",{staticClass:"tableBox"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.currentTableData,stripe:"",border:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{prop:"company",label:"组织名称","min-width":"45"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.company))]}}],null,!1,876992762)}),t("el-table-column",{attrs:{prop:"phone",label:"电话/邮箱","min-width":"45"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名","min-width":"45","show-overflow-tooltip":"","label-class-name":"address-column"}}),t("el-table-column",{attrs:{prop:"submission_time",label:"提交时间","min-width":"45"}}),t("el-table-column",{attrs:{prop:"remarks",label:"备注","min-width":"45"}}),t("el-table-column",{attrs:{label:"操作","min-width":"35"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("button",{staticStyle:{color:"#308fff",background:"none",border:"none",cursor:"pointer","margin-left":"25px"},on:{click:function(t){return e.ajax_move_to_approved(a.userid,a.companyNumber,a.orgid,a.phone,a.name,a.submission_time)}}},[e._v(" 通过 ")]),t("button",{staticStyle:{color:"#308fff",background:"none",border:"none",cursor:"pointer","margin-left":"35px"},on:{click:function(t){return e.ajax_move_to_rejected(a.userid,a.companyNumber)}}},[e._v(" 拒绝 ")])]}}],null,!1,2313048992)})],1)],1):e._e(),e.Pending_request?t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,"page-sizes":e.pageSizeOptions,total:e.tableData.length,layout:"total,prev, pager, next, jumper"},on:{"size-change":e.handlePageSizeChange,"current-change":e.handlePageChange}}):e._e(),e.isApproved?t("div",{staticClass:"tableBox"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.currentApprovedData,stripe:"",border:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{prop:"company",label:"组织名称","min-width":"40"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.company))]}}],null,!1,876992762)}),t("el-table-column",{attrs:{prop:"phone",label:"电话/邮箱","min-width":"40"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名","min-width":"40","show-overflow-tooltip":"","label-class-name":"address-column"}}),t("el-table-column",{attrs:{prop:"submission_time",label:"提交时间","min-width":"35"}}),t("el-table-column",{attrs:{prop:"remarks",label:"备注","min-width":"35"}}),t("el-table-column",{attrs:{prop:"Pending_time",label:"审核时间",width:"300"}}),t("el-table-column",{attrs:{prop:"open_organization",label:"开通组织",width:"395"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.open_organization))]}}],null,!1,3928457997)})],1),t("el-pagination",{attrs:{"current-page":e.currentApprovedPage,"page-size":e.pageSize,"page-sizes":e.pageSizeOptions,total:e.approvedData.length,layout:"total,sizes,prev, pager, next, jumper"},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleApprovedPageChange}})],1):e._e(),e.isRefused?t("div",{staticClass:"tableBox"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.currentRefusedData,stripe:"",border:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{prop:"company",label:"组织名称","min-width":"40"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.company))]}}],null,!1,876992762)}),t("el-table-column",{attrs:{prop:"phone",label:"电话/邮箱","min-width":"40"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名","min-width":"35","show-overflow-tooltip":"","label-class-name":"address-column"}}),t("el-table-column",{attrs:{prop:"submission_time",label:"提交时间",width:"300"}}),t("el-table-column",{attrs:{prop:"remarks",label:"备注","min-width":"40"}}),t("el-table-column",{attrs:{prop:"Pending_time",label:"审核时间","min-width":"40"}}),t("el-table-column",{attrs:{label:"操作","min-width":"35"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("button",{staticStyle:{color:"#308fff",background:"none",border:"none",cursor:"pointer","margin-left":"25px"},on:{click:function(t){return e.ajax__move_to_pending_from_rejected(a.userid,a.companyNumber)}}},[e._v(" 移动至待审核 ")])]}}],null,!1,4062105277)})],1),t("el-pagination",{attrs:{"current-page":e.currentRefusedPage,"page-size":e.pageSize,"page-sizes":e.pageSizeOptions,total:e.RefusedData.length,layout:"total,sizes,prev, pager, next, jumper"},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleRefusedPageChange}})],1):e._e(),e.isAll?t("div",{staticClass:"tableBox"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.currentAllData,stripe:"",border:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{prop:"company",label:"组织名称","min-width":"40"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.company))]}}],null,!1,876992762)}),t("el-table-column",{attrs:{prop:"phone",label:"电话/邮箱","min-width":"40"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名","min-width":"35","show-overflow-tooltip":"","label-class-name":"address-column"}}),t("el-table-column",{attrs:{prop:"submission_time",label:"提交时间","min-width":"35"}}),t("el-table-column",{attrs:{prop:"remarks",label:"备注","min-width":"35"}}),t("el-table-column",{attrs:{prop:"Pending_time",label:"审核时间","min-width":"40"}}),t("el-table-column",{attrs:{label:"操作","min-width":"35",prop:"status"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{staticStyle:{"border-radius":"5px",padding:"4px 12px","font-size":"14px"},attrs:{type:e.getButtonType(a.row.status),disabled:!1}},[e._v(" "+e._s(e.getStatusText(a.row.status))+" ")])]}}],null,!1,520810721)})],1),t("el-pagination",{attrs:{"current-page":e.currentAllPage,"page-size":e.pageSize,"page-sizes":[5,10,25],total:e.AllData.length,layout:"total,sizes,prev, pager, next, jumper"},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleAllPageChange}})],1):e._e()],1)])])},j=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"title_examine"},[t("div",{staticClass:"pub_title"},[e._v("账号审核")])])}],P={name:"IndexTable",components:{},data(){return{checked:!0,selectedOptions:[],showCompany:!1,selectedOrg:"CN",checkboxStates:Array(10).fill(!1),selectedSchools:Array(16).fill(""),showCompanyList:(0,s.reactive)(Array(8).fill(!1)),button:Array(10).fill(!1),currentPage:1,currentApprovedPage:1,currentRefusedPage:1,currentAllPage:1,pageSize:10,pageSizeOptions:[10,25,50],tableData:[{company:"北京科技有限公司",phone:"010-12345678",name:"张三",submission_time:"2024-12-20 10:00",remarks:"暂无备注",userid:1,companyNumber:"BJKJ001"},{company:"上海创新企业",phone:"021-87654321",name:"李四",submission_time:"2024-12-21 12:00",remarks:"待审核",userid:2,companyNumber:"SHCX002"},{company:"广州实业集团",phone:"020-23456789",name:"王五",submission_time:"2024-12-22 14:30",remarks:"需要更多资料",userid:3,companyNumber:"GZSY003"}],approvedData:[],RefusedData:[],AllData:[],Pending_request:!0,isPending:!0,isApproved:!1,isRefused:!1,isAll:!1,showModal:!1,showConfirmationModal:!1}},computed:{currentTableData(){const e=(this.currentPage-1)*this.pageSize,t=this.currentPage*this.pageSize;return this.tableData.slice(e,t)},currentApprovedData(){const e=(this.currentApprovedPage-1)*this.pageSize,t=this.currentApprovedPage*this.pageSize;return this.approvedData.slice(e,t)},currentRefusedData(){const e=(this.currentRefusedPage-1)*this.pageSize,t=this.currentRefusedPage*this.pageSize;return this.RefusedData.slice(e,t)},currentAllData(){const e=(this.currentAllPage-1)*this.pageSize,t=this.currentAllPage*this.pageSize;return this.AllData.slice(e,t)}},methods:{getStatusText(e){const t={0:"待审核",1:"已通过",2:"已拒绝"};return t[e]||"未知状态"},getButtonType(e){const t={0:"primary",1:"success",2:"danger"};return t[e]||"default"},headerCellStyle(){return{backgroundColor:"#f1f1f1"}},handlePageChange(e){this.currentPage=e},handleApprovedPageChange(e){this.currentApprovedPage=e},handleRefusedPageChange(e){this.currentRefusedPage=e},handleAllPageChange(e){this.currentAllPage=e},showModalHandler(){this.showModal=!0},performSearch(){console.log("执行搜索")},handleCreateAccount(){console.log("账户创建完成"),this.showModal=!1,this.showConfirmationModal=!0},notifyApplicant(){this.$message.success("通知申请人成功!"),this.showConfirmationModal=!1},show_company(){this.showCompany=!this.showCompany},toggleCompany(e){this.showCompanyList[e]=!this.showCompanyList[e]},showPending(){this.isPending=!0,this.isApproved=!1,this.isRefused=!1,this.isAll=!1,this.Pending_request=!0},showApproved(){this.Pending_request=!1,this.isPending=!1,this.isApproved=!0,this.isRefused=!1,this.isAll=!1},showRefused(){this.isPending=!1,this.isApproved=!1,this.isRefused=!0,this.isAll=!1,this.Pending_request=!1},showAll(){this.isPending=!1,this.isApproved=!1,this.isRefused=!1,this.isAll=!0,this.Pending_request=!1},selectOrg(e){this.selectedOrg=e},handlePageSizeChange(e){this.pageSize=e},ajaxpending(){const e=[y.i.pending];this.$ajax.post(y.i.baseUrl,e).then((e=>{this.tableData=e.data[0].map((e=>({company:e.schoolName||"未知",phone:e.contact_info||"未知",name:e.name||"未知",submission_time:e.create_at||"未知",remarks:e.remark||"未知",userid:e.id||"未知",orgid:e.org_id}))),console.log("待审核的数据为:",e.data)})).catch((e=>{this.$message.error("查询失败"),console.error(e)}))},ajaxapproved(){const e=[y.i.approved];this.$ajax.post(y.i.baseUrl,e).then((e=>{this.approvedData=e.data[0].map((e=>({company:e.schoolName||"未知",phone:e.contact_info||"未知",name:e.name||"未知",submission_time:e.create_at||"未知",remarks:e.remark||"未知",Pending_time:e.active_at||"未知",open_organization:e.school_name||"未知",userid:e.id||"未知"}))),console.log("已通过的数据为:",e.data)})).catch((e=>{this.$message.error("查询失败"),console.error(e)}))},ajaxrefused(){const e=[y.i.refused];this.$ajax.post(y.i.baseUrl,e).then((e=>{this.RefusedData=e.data[0].map((e=>({company:e.schoolName||"未知",phone:e.contact_info||"未知",name:e.name||"未知",submission_time:e.create_at||"未知",remarks:e.remark||"未知",Pending_time:e.active_at||"未知",userid:e.id||"未知"}))),console.log("已拒绝的数据为:",e.data)})).catch((e=>{this.$message.error("查询失败"),console.error(e)}))},ajaxAll(){console.log("获取所有记录");const e=y.i.allRecords.r_types.map((e=>{const t={functionName:y.i.allRecords.functionName,r_type:e,page:y.i.allRecords.page,r_num:y.i.allRecords.r_num};return this.$ajax.post(y.i.baseUrl,[t])}));Promise.all(e).then((e=>{const t=y.i.allRecords.processData(e);this.AllData=t,console.log(this.AllData),this.refreshTableData()})).catch((e=>{this.$message.error("查询失败"),console.error(e)}))},ajax_move_to_approved(e,t,a,s,o){const n=y.i.moveToApproved.successMessage;this.$confirm("您确定将此数据移至“已通过”状态吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{let i=[{functionName:"insert_request_type1",p_userid:e,p_schoolName:t,p_u_couent:a,p_u_name:s,p_u_time:o}];this.$ajax.post(y.i.baseUrl,i).then((e=>{console.log(e),this.$message({type:"success",message:n}),this.refreshTableData(),console.log("通过的数据内容为:",e.data)})).catch((e=>{this.$message.error("操作失败"),console.error("请求失败,错误信息:",e)}))})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))},ajax_move_to_rejected(e){const t=y.i.moveToRejected.successMessage;this.$confirm("您确定将此数据移至“已拒绝”状态吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{let a=[{functionName:y.i.moveToRejected.functionName,u_id:e}];this.$ajax.post(y.i.baseUrl,a).then((a=>{console.log(a),this.$message({type:"success",message:t}),this.refreshTableData(),console.log("此条数据处理后的id为:",e)})).catch((e=>{this.$message.error("操作失败"),console.error("请求失败,错误信息:",e)}))})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))},refreshTableData(){this.ajaxpending(),this.ajaxapproved(),this.ajaxrefused()},ajax__move_to_pending_from_rejected(e){let t=[{functionName:y.i.moveToPending.functionName,u_id:e}];const a=y.i.moveToPending.successMessage;this.$confirm("此操作将会将该条数据移回待审核, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$ajax.post(y.i.baseUrl,t).then((t=>{console.log(t),this.$message({type:"success",message:a}),this.refreshTableData(),console.log("此条数据处理后的id为:",e),this.ajaxpending(e)})).catch((e=>{this.$message.error("处理失败"),console.error("请求失败,错误信息:",e)}))})).catch((()=>{this.$message({type:"info",message:"已取消移动至待审核"})}))}},mounted(){this.ajaxpending(),this.ajaxapproved(),this.ajaxrefused(),this.ajaxAll()}},A=P,T=(0,i.A)(A,k,j,!1,null,"299be3ca",null),N=T.exports;s["default"].use(u.Ay);const $=[{path:"/login",component:()=>a.e(220).then(a.bind(a,220)),meta:{title:"登录",keepAlive:!1}},{path:"/",name:"home",component:f,redirect:"/user-list",children:[{path:"user-list",name:"UserList",component:S},{path:"user-examine",name:"UserExamine",component:N}]},{path:"/examineDialog",name:"examineDialog",component:()=>a.e(448).then(a.bind(a,6306))}],O=new u.Ay({routes:$});var z=O;const D={courseId:e=>e.app.courseId,testId:e=>e.app.testId,shareCourseId:e=>e.app.shareCourseId,id:e=>e.user.id,userinfo:e=>e.user.userinfo,token:e=>e.user.token};var E=D;const R={courseId:"",testId:"",shareCourseId:""},I={SET_COURSEID:(e,t)=>{e.courseId=t},SET_TESTID:(e,t)=>{e.testId=t},SET_SHARECOURSEID:(e,t)=>{e.shareCourseId=t}},U={};var V={state:R,mutations:I,actions:U},B=(a(4114),a(4373)),L=a(9122),M=a.n(L);B.A.defaults.timeout=6e5,B.A.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8",B.A.defaults.baseURL={NODE_ENV:"production",VUE_APP_ENV:"production",BASE_URL:"/"}.NODE_HOST,console.log({NODE_ENV:"production",VUE_APP_ENV:"production",BASE_URL:"/"});const q=B.A.CancelToken;let F;function Q(e){return JSON.stringify(e)}function H(e,t,a){return new Promise(((s,o)=>{B.A.post(e,t,a?{cancelToken:a.token}:"").then((e=>{s(e)}),(e=>{o(e)})).catch((e=>{o(e)}))}))}function K(e,t,a){return new Promise(((s,o)=>{B.A.put(e,t,a?{cancelToken:a.token}:"").then((e=>{s(e)}),(e=>{o(e)})).catch((e=>{o(e)}))}))}function W(e,t,a){return new Promise(((s,o)=>{let n=a?a.token:"";B.A.get(e,{params:t,cancelToken:n}).then((e=>{s(e)}),(e=>{o(e)})).catch((e=>{o(e)}))}))}B.A.interceptors.request.use((e=>{if("https://gpt.cocorobo.cn/search_image"===e.url||"https://gpt.cocorobo.cn/chat"===e.url||"https://gpt4.cocorobo.cn/create_free_assistants"===e.url||"https://gpt4.cocorobo.cn/assistants_completion_response"===e.url)e.data=Q(e.data);else if(-1!==e.url.indexOf("https://gpt4.cocorobo.cn/")||-1!==e.url.indexOf("https://claude3.cocorobo.cn/")||-1!==e.url.indexOf("https://llm.cocorobo.cn/"))e.headers={"Content-Type":"application/json"};else if(e.data&&"1"===e.data[0].post&&"post"===e.method)e.data="mode="+Object.values(e.data[0]).join(",");else if("post"===e.method){const t={};for(const a in e.data[0])Object.hasOwnProperty.call(e.data[0],a)&&(t[a]=encodeURIComponent(e.data[0][a]));e.data=M().stringify([t])}else{const t={};for(const a in e.data)Object.hasOwnProperty.call(e.data,a)&&(t[a]=encodeURIComponent(e.data[a]));e.data=t}return e}),(e=>Promise.reject(e))),B.A.interceptors.response.use((e=>{if(!e.data.success){let t=e.data.token;localStorage.setItem("access_token",t)}return e}),(e=>(B.A.isCancel(e)?console.log("请求已取消",e.message):"401"==e.response.data.status&&(void 0).$router.push("/login"),Promise.reject(e))));var J={get:W,post:H,put:K,setCancelSource:()=>(F=q.source(),F)},G=a(4642);function X(){return J.get("//beta.api.cocorobo.cn/api/getcookieuserid")}function Y(e){return J.get(`${G.baseApi}/selectUser`,e)}var Z=a(8704);const ee="vue_admin_template_token";function te(){return Z.A.get(ee)}function ae(e){return Z.A.set(ee,e)}function se(){return Z.A.remove(ee)}const oe=()=>({token:te(),id:"",roles:[],name:"",username:"",avatar:"",is_init:!1,userinfo:{}}),ne=oe(),ie={RESET_STATE:e=>{Object.assign(e,oe())},SET_TOKEN:(e,t)=>{e.token=t},SET_ROLES:(e,t)=>{e.roles=t},SET_ID:(e,t)=>{e.id=t},SET_NAME:(e,t)=>{e.name=t},SET_USERNAME:(e,t)=>{e.username=t},SET_IS_INIT:(e,t)=>{e.is_init=t},SET_AVATAR:(e,t)=>{e.avatar=t},SET_USERINFO:(e,t)=>{e.userinfo=t}},re={login({commit:e}){return new Promise(((t,a)=>{X().then((a=>{console.log(a);var s=a.data[0][0];e("SET_ID",s.userid),ae(s.userid),t(s.userid)})).catch((e=>{a(e)}))}))},getInfo({commit:e,state:t}){return new Promise(((a,s)=>{e("SET_ID",t.token),Y({userid:t.token}).then((t=>{console.log(t);const o=t.data[0][0];o||s("验证失败,请重新登录。"),e("SET_USERINFO",o),a(o)})).catch((e=>{s(e)}))}))},logout({commit:e}){return new Promise((t=>{e("SET_TOKEN",""),e("SET_ROLES",[]),se(),e("RESET_STATE"),t()}))},resetToken({commit:e}){return new Promise((t=>{e("SET_TOKEN",""),e("SET_ROLES",[]),se(),t()}))}};var le={namespaced:!0,state:ne,mutations:ie,actions:re};s["default"].use(h.Ay);const ce=new h.Ay.Store({modules:{app:V,user:le},getters:E});var ue=ce,de=a(9143),pe=a.n(de),he=a(4130),me=a.n(he);me().configure({showSpinner:!1});const _e=["/login"];z.beforeEach((async(e,t,a)=>{me().start();const s=ue.getters.token;if(s)if("/login"===e.path)a({path:"/"}),me().done();else{const t=ue.getters.userinfo&&Object.keys(ue.getters.userinfo).length>0;if(console.log("store.getters",ue.getters),console.log("userinfo",t),t)a();else try{const t=await ue.dispatch("user/getInfo");await ue.commit("user/SET_USERINFO",t),a({...e,replace:!0})}catch(o){a(`/login?redirect=${e.path}`),me().done()}}else-1!==_e.indexOf(e.path)?a():(a(`/login?redirect=${e.path}`),me().done())})),z.afterEach((()=>{me().done()})),s["default"].config.productionTip=!1,s["default"].use(pe()),s["default"].prototype.$ajax=J,new s["default"]({router:z,store:ue,render:e=>e(c)}).$mount("#app")},2634:function(){}},t={};function a(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={id:s,loaded:!1,exports:{}};return e[s].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=e,function(){a.amdO={}}(),function(){var e=[];a.O=function(t,s,o,n){if(!s){var i=1/0;for(u=0;u<e.length;u++){s=e[u][0],o=e[u][1],n=e[u][2];for(var r=!0,l=0;l<s.length;l++)(!1&n||i>=n)&&Object.keys(a.O).every((function(e){return a.O[e](s[l])}))?s.splice(l--,1):(r=!1,n<i&&(i=n));if(r){e.splice(u--,1);var c=o();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[s,o,n]}}(),function(){a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,{a:t}),t}}(),function(){a.d=function(e,t){for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}}(),function(){a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,s){return a.f[s](e,t),t}),[]))}}(),function(){a.u=function(e){return"js/"+(448===e?"examineDialog":e)+"."+{220:"56599a77",448:"af519db0"}[e]+".js"}}(),function(){a.miniCssF=function(e){return"css/"+(448===e?"examineDialog":e)+"."+{220:"f9f90f2a",448:"c53af6eb"}[e]+".css"}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="userManage:";a.l=function(s,o,n,i){if(e[s])e[s].push(o);else{var r,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==s||d.getAttribute("data-webpack")==t+n){r=d;break}}r||(l=!0,r=document.createElement("script"),r.charset="utf-8",r.timeout=120,a.nc&&r.setAttribute("nonce",a.nc),r.setAttribute("data-webpack",t+n),r.src=s),e[s]=[o];var p=function(t,a){r.onerror=r.onload=null,clearTimeout(h);var o=e[s];if(delete e[s],r.parentNode&&r.parentNode.removeChild(r),o&&o.forEach((function(e){return e(a)})),t)return t(a)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}}}(),function(){a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){a.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){a.p="/"}(),function(){if("undefined"!==typeof document){var e=function(e,t,s,o,n){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",a.nc&&(i.nonce=a.nc);var r=function(a){if(i.onerror=i.onload=null,"load"===a.type)o();else{var s=a&&a.type,r=a&&a.target&&a.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+r+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=s,l.request=r,i.parentNode&&i.parentNode.removeChild(i),n(l)}};return i.onerror=i.onload=r,i.href=t,s?s.parentNode.insertBefore(i,s.nextSibling):document.head.appendChild(i),i},t=function(e,t){for(var a=document.getElementsByTagName("link"),s=0;s<a.length;s++){var o=a[s],n=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(n===e||n===t))return o}var i=document.getElementsByTagName("style");for(s=0;s<i.length;s++){o=i[s],n=o.getAttribute("data-href");if(n===e||n===t)return o}},s=function(s){return new Promise((function(o,n){var i=a.miniCssF(s),r=a.p+i;if(t(i,r))return o();e(s,r,null,o,n)}))},o={524:0};a.f.miniCss=function(e,t){var a={220:1,448:1};o[e]?t.push(o[e]):0!==o[e]&&a[e]&&t.push(o[e]=s(e).then((function(){o[e]=0}),(function(t){throw delete o[e],t})))}}}(),function(){var e={524:0};a.f.j=function(t,s){var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)s.push(o[2]);else{var n=new Promise((function(a,s){o=e[t]=[a,s]}));s.push(o[2]=n);var i=a.p+a.u(t),r=new Error,l=function(s){if(a.o(e,t)&&(o=e[t],0!==o&&(e[t]=void 0),o)){var n=s&&("load"===s.type?"missing":s.type),i=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",r.name="ChunkLoadError",r.type=n,r.request=i,o[1](r)}};a.l(i,l,"chunk-"+t,t)}},a.O.j=function(t){return 0===e[t]};var t=function(t,s){var o,n,i=s[0],r=s[1],l=s[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(o in r)a.o(r,o)&&(a.m[o]=r[o]);if(l)var u=l(a)}for(t&&t(s);c<i.length;c++)n=i[c],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return a.O(u)},s=self["webpackChunkuserManage"]=self["webpackChunkuserManage"]||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))}();var s=a.O(void 0,[504],(function(){return a(9754)}));s=a.O(s)})();
  2. //# sourceMappingURL=app.bb4ed606.js.map