快速开发工作流_03_集成在线流程设计器_内置用户免登录
生活随笔
收集整理的這篇文章主要介紹了
快速开发工作流_03_集成在线流程设计器_内置用户免登录
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
接上一篇:快速開發工作流_02_集成在線流程設計器
https://gblfy.blog.csdn.net/article/details/103676784
文章目錄
- 八、內置用戶免登錄
- 8.1. 定位url-config.js
- 8.2. 替換url
- 8.3. 添加配置類AdminRemoteAccountResource
- 8.4. 啟動類排除權限校驗
- 8.5. 碼云地址
八、內置用戶免登錄
8.1. 定位url-config.js
springboot-flowable-modeler\flowable\src\main\resources\static\scripts\configuration\url-config.js
8.2. 替換url
將
return FLOWABLE.CONFIG.contextRoot + '/app/rest/account';替換為
return FLOWABLE.CONFIG.contextRoot + '/admin/rest/account';8.3. 添加配置類AdminRemoteAccountResource
package com.gblfy.flowable.controller;import org.flowable.idm.api.User; import org.flowable.idm.engine.impl.persistence.entity.UserEntityImpl; import org.flowable.ui.common.model.UserRepresentation; import org.flowable.ui.common.security.SecurityUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController;import java.util.ArrayList; import java.util.List;/*** @author gblfy* @ClassNme AdminRemoteAccountResource* @Description 實現內置admin用戶免登陸* @Date 2019/11/10 15:13* @version1.0*/ @RestController @RequestMapping("/admin") public class AdminRemoteAccountResource {/*** GET /rest/account -> get the current user.*/@RequestMapping(value = "/rest/account", method = RequestMethod.GET, produces = "application/json")public UserRepresentation getAccount() {User user=new UserEntityImpl();user.setId("admin");SecurityUtils.assumeUser(user);UserRepresentation userRepresentation = new UserRepresentation();userRepresentation.setId("admin");userRepresentation.setFirstName("admin");List<String> privileges=new ArrayList<>();privileges.add("flowable-idm");privileges.add("flowable-modeler");privileges.add("flowable-task");userRepresentation.setPrivileges(privileges);return userRepresentation;} }8.4. 啟動類排除權限校驗
package com.gblfy.flowable;import com.gblfy.flowable.config.ApplicationConfiguration; import com.gblfy.flowable.servlet.AppDispatcherServletConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Import; import org.springframework.transaction.annotation.EnableTransactionManagement;@Import({ApplicationConfiguration.class,AppDispatcherServletConfiguration.class }) @ComponentScan(basePackages = {"com.gblfy.flowable"}) @EnableTransactionManagement @SpringBootApplication(exclude = {SecurityAutoConfiguration.class}) //@SpringBootApplication public class FlowableApplication {public static void main(String[] args) {SpringApplication.run(FlowableApplication.class, args);}}8.5. 碼云地址
https://gitee.com/gb_90/springboot-flowable-modeler
總結
以上是生活随笔為你收集整理的快速开发工作流_03_集成在线流程设计器_内置用户免登录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Spring Boot2 整合 MyBa
- 下一篇: -bash: killall: comm