日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

快速开发工作流_03_集成在线流程设计器_内置用户免登录

發布時間:2024/9/27 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 快速开发工作流_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_集成在线流程设计器_内置用户免登录的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。