webpackJsonp([34],{"+S5g":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("Dd8w"),o=i.n(a),s=i("vLgD");var r={name:"oauth2Client",data:function(){return{loading:!1,params:{page_no:1,page_size:10},tableData:"",editForm:{secret:""},advancedForm:{},formRules:{name:[this.MixinRequired("客户端名称必填!")],client_id:[this.MixinRequired("客户端id必填!")],secret:[this.MixinRequired("客户端secret必填!")],status:[this.MixinRequired("客户端状态必填!")],access_token_validity_seconds:[this.MixinRequired("访问令牌时效必填!")],refresh_token_validity_seconds:[this.MixinRequired("刷新令牌时效必填!")],authorized_grant_types:[this.MixinRequired("授权类型必填!")],redirect_uris:[this.MixinRequired("可重定向uri必填!")]},dialogVisible:!1}},watch:{},mounted:function(){this.GET_List()},methods:{advancedSearchEvent:function(){this.params=o()({},this.params,this.advancedForm),this.params.page_no=1,this.GET_List()},handlePageSizeChange:function(e){this.params.page_size=e,this.GET_List()},handlePageCurrentChange:function(e){this.params.page_no=e,this.GET_List()},handleAdd:function(){this.editForm={status:0},this.dialogVisible=!0},handleEdit:function(e){this.editForm=this.MixinClone(e),this.editForm.redirect_uris=this.editForm.redirect_uris?this.editForm.redirect_uris.join(","):"",this.editForm.scopes=this.editForm.scopes?this.editForm.scopes.join(","):"",this.dialogVisible=!0},handleDelete:function(e){var t=this;this.$confirm("确定要删除吗?","提示",{type:"warning"}).then(function(){(function(e){return Object(s.a)({url:"/admin/systems/oauth2-client/"+e,method:"delete"})})(e).then(function(){t.$message.success("删除成功!"),t.GET_List()})}).catch(function(){})},handleDialogOpen:function(){var e=this;setTimeout(function(){e.$refs.editForm.clearValidate()})},submitEditForm:function(){var e=this;this.$refs.editForm.validate(function(t){if(!t)return!1;var i=e.editForm.id,a=e.MixinClone(e.editForm);a.redirect_uris&&(a.redirect_uris=a.redirect_uris.split(",")),""===a.redirect_uris&&(a.redirect_uris=[]),a.scopes&&(a.scopes=a.scopes.split(",")),""===a.scopes&&(a.scopes=[]),i?function(e,t){return Object(s.a)({url:"/admin/systems/oauth2-client/"+e,method:"put",headers:{"Content-Type":"application/json"},data:t})}(i,a).then(function(t){e.dialogVisible=!1,e.$message.success("修改成功!"),e.GET_List()}):function(e){return Object(s.a)({url:"/admin/systems/oauth2-client",method:"post",headers:{"Content-Type":"application/json"},data:e})}(a).then(function(){e.dialogVisible=!1,e.$message.success("添加成功!"),e.GET_List()})})},searchEvent:function(e){this.params=o()({},this.params,{name:e}),this.params.page_no=1,this.GET_List()},GET_List:function(){var e,t=this;this.loading=!0,(e=this.params,Object(s.a)({url:"/admin/systems/oauth2-client",method:"get",params:e})).then(function(e){t.loading=!1,t.tableData=e}).catch(function(){t.loading=!1})},showRedirectUris:function(){return this.editForm.authorized_grant_types&&this.editForm.authorized_grant_types.some(function(e){return"authorization_code"===e||"implicit"===e})},showScopes:function(){return this.editForm.authorized_grant_types&&this.editForm.authorized_grant_types.some(function(e){return"password"===e||"authorization_code"===e||"implicit"===e})},randomClientId:function(){this.$set(this.editForm,"client_id",this.generateRandom(10))},randomSecret:function(){this.$set(this.editForm,"secret",this.generateRandom(30))},generateRandom:function(e){for(var t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i="",a=0;a