Code Monkey home page Code Monkey logo

case-refine-admin's Introduction

基于 Fireboom 的自带 refine 后台应用

  1. 数据库准备

本地准备一个 mysql 数据库,连接信息为 mysql://[email protected]:3306/fireboom-refine

  1. authing 应用准备

更新server/store/list/FbAuthentication配置文件,参考

[
 {
  "authSupplier": "openid",
  "config": {"id":"authing","clientId":"xxx","clientSecret":"xxx","issuer":"https://xxx.authing.cn/oidc","discoveryURL":"https://xxx.authing.cn/oidc/.well-known/openid-configuration","jwks":0,"jwksJSON":"","jwksURL":"https://xxx.authing.cn/oidc/.well-known/jwks.json","userInfoEndpoint":"https://xxx.authing.cn/me","userInfoCacheTtlSeconds":0},
  "createTime": "",
  "id": 3,
  "isDel": 0,
  "name": "authing",
  "switchState": ["cookieBased","tokenBased"],
  "updateTime": "2022-12-12 01:01:01"
 }
 ]
  1. 安装
cd admin
pnpm i
# yarn
# npm i
  1. 运行

启动admin服务

pnpm dev

新开一个shell启动fireboom服务

cd server
./run.sh

新开一个shell启动钩子服务

cd server/custom-ts
yarn
# npm i
npm run dev
  1. 在数据库中插入初始数据
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (1, NULL, '控制台', 'Dashboard', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (2, NULL, '系统管理', 'Manage', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (3, 2, '用户管理', 'User', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (4, 2, '角色管理', 'Role', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (5, 2, '菜单管理', 'Menu', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (6, 2, 'API管理', 'Api', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Menu` (`id`, `parentId`, `label`, `path`, `icon`, `sort`, `level`) VALUES (7, NULL, '宠物管理', 'Pet', NULL, 0, 1);
INSERT INTO `fireboom-refine`.`Role` (`id`, `code`, `desc`) VALUES (1, 'admin', '管理员');
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (1, 1);
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (2, 1);
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (3, 1);
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (4, 1);
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (5, 1);
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (6, 1);
INSERT INTO `fireboom-refine`.`_MenuToRole` (`A`, `B`) VALUES (7, 1);
  1. 打开 http://localhost:9123/#/workbench/setting 查看安全 -> 重定向URL,新增一个localhost:4321/oidc/callback重定向URL

  2. 打开 http://localhost:4321 完成登录,然后为该用户赋予权限(假设user.id=1)

INSERT INTO `fireboom-refine`.`_RoleToUser` (`A`, `B`) VALUES (1, 1);

重新刷新页面

case-refine-admin's People

Contributors

erguotou520 avatar ansoncode avatar

Stargazers

daqi avatar  avatar

case-refine-admin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.