465 changed files with 11753 additions and 8662 deletions
@ -0,0 +1,17 @@ |
|||
name: Issue Close Require |
|||
|
|||
on: |
|||
schedule: |
|||
- cron: '0 0 * * *' |
|||
|
|||
jobs: |
|||
close-issues: |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: need reproduction |
|||
uses: actions-cool/issues-helper@v2.1.1 |
|||
with: |
|||
actions: 'close-issues' |
|||
token: ${{ secrets.OPER_TOKEN }} |
|||
labels: 'need reproduction' |
|||
inactive-day: 3 |
|||
@ -0,0 +1,29 @@ |
|||
name: Issue Labeled |
|||
|
|||
on: |
|||
issues: |
|||
types: [labeled] |
|||
|
|||
jobs: |
|||
reply-labeled: |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: remove pending |
|||
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug' |
|||
uses: actions-cool/issues-helper@v2.1.1 |
|||
with: |
|||
actions: 'remove-labels' |
|||
token: ${{ secrets.OPER_TOKEN }} |
|||
issue-number: ${{ github.event.issue.number }} |
|||
labels: 'bug: pending triage' |
|||
|
|||
- name: need reproduction |
|||
if: github.event.label.name == 'need reproduction' |
|||
uses: actions-cool/issues-helper@v2.1.1 |
|||
with: |
|||
actions: 'create-comment, remove-labels' |
|||
token: ${{ secrets.OPER_TOKEN }} |
|||
issue-number: ${{ github.event.issue.number }} |
|||
body: | |
|||
Hello @${{ github.event.issue.user.login }}. Please provide the complete reproduction steps and code. Issues labeled by `need reproduction` will be closed if no activities in 3 days. |
|||
labels: 'bug: pending triage' |
|||
@ -0,0 +1,24 @@ |
|||
name: Create Release |
|||
|
|||
on: |
|||
push: |
|||
tags: |
|||
- v* |
|||
|
|||
jobs: |
|||
build: |
|||
name: Create Release |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- name: Checkout code |
|||
uses: actions/checkout@master |
|||
|
|||
- name: Create Release for Tag |
|||
id: release_tag |
|||
uses: yyx990803/release-tag@master |
|||
env: |
|||
GITHUB_TOKEN: ${{ secrets.OPER_TOKEN }} |
|||
with: |
|||
tag_name: ${{ github.ref }} |
|||
body: | |
|||
Please refer to [CHANGELOG.md](https://github.com/anncwb/vue-vben-admin/blob/main/CHANGELOG.md) for details. |
|||
@ -1,8 +1,8 @@ |
|||
#!/bin/sh |
|||
. "$(dirname "$0")/_/husky.sh" |
|||
. "$(dirname "$0")/common.sh" |
|||
#. "$(dirname "$0")/_/husky.sh" |
|||
#. "$(dirname "$0")/common.sh" |
|||
|
|||
[ -n "$CI" ] && exit 0 |
|||
#[ -n "$CI" ] && exit 0 |
|||
|
|||
# Format and submit code according to lintstagedrc.js configuration |
|||
npm run lint:lint-staged |
|||
# npm run lint:lint-staged |
|||
|
|||
@ -0,0 +1,175 @@ |
|||
<div align="center"> <a href="https://github.com/anncwb/vue-vben-admin"> <img alt="VbenAdmin Logo" width="200" height="200" src="https://anncwb.github.io/anncwb/images/logo.png"> </a> <br> <br> |
|||
|
|||
[](LICENSE) |
|||
|
|||
<h1>Vue vben admin</h1> |
|||
</div> |
|||
|
|||
**中文** | [English](./README.md) |
|||
|
|||
## 简介 |
|||
|
|||
Vue Vben Admin 是一个免费开源的中后台模版。使用了最新的`vue3`,`vite2`,`TypeScript`等主流技术开发,开箱即用的中后台前端解决方案,也可用于学习参考。 |
|||
|
|||
## 特性 |
|||
|
|||
- **最新技术栈**:使用 Vue3/vite2 等前端前沿技术开发 |
|||
- **TypeScript**: 应用程序级 JavaScript 的语言 |
|||
- **主题**:可配置的主题 |
|||
- **国际化**:内置完善的国际化方案 |
|||
- **Mock 数据** 内置 Mock 数据方案 |
|||
- **权限** 内置完善的动态路由权限生成方案 |
|||
- **组件** 二次封装了多个常用的组件 |
|||
|
|||
## 预览 |
|||
|
|||
- [vue-vben-admin](https://vvbin.cn/next/) - 完整版中文站点 |
|||
- [vue-vben-admin-gh-pages](https://anncwb.github.io/vue-vben-admin/) - 完整版 github 站点 |
|||
- [vben-admin-thin-next](https://vvbin.cn/thin/next/) - 简化版中文站点 |
|||
- [vben-admin-thin-gh-pages](https://anncwb.github.io/vben-admin-thin-next/) - 简化版 github 站点 |
|||
|
|||
测试账号: vben/123456 |
|||
|
|||
<p align="center"> |
|||
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview1.png"> |
|||
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview2.png"> |
|||
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview3.png"> |
|||
</p> |
|||
|
|||
### 使用 Gitpod |
|||
|
|||
在 Gitpod(适用于 GitHub 的免费在线开发环境)中打开项目,并立即开始编码. |
|||
|
|||
[](https://gitpod.io/#https://github.com/anncwb/vue-vben-admin) |
|||
|
|||
## 文档 |
|||
|
|||
[文档地址](https://vvbin.cn/doc-next/) |
|||
|
|||
## 准备 |
|||
|
|||
- [node](http://nodejs.org/) 和 [git](https://git-scm.com/) -项目开发环境 |
|||
- [Vite](https://vitejs.dev/) - 熟悉 vite 特性 |
|||
- [Vue3](https://v3.vuejs.org/) - 熟悉 Vue 基础语法 |
|||
- [TypeScript](https://www.typescriptlang.org/) - 熟悉`TypeScript`基本语法 |
|||
- [Es6+](http://es6.ruanyifeng.com/) - 熟悉 es6 基本语法 |
|||
- [Vue-Router-Next](https://next.router.vuejs.org/) - 熟悉 vue-router 基本使用 |
|||
- [Ant-Design-Vue](https://2x.antdv.com/docs/vue/introduce-cn/) - ui 基本使用 |
|||
- [Mock.js](https://github.com/nuysoft/Mock) - mockjs 基本语法 |
|||
|
|||
## 安装使用 |
|||
|
|||
- 获取项目代码 |
|||
|
|||
```bash |
|||
git clone https://github.com/anncwb/vue-vben-admin.git |
|||
``` |
|||
|
|||
- 安装依赖 |
|||
|
|||
```bash |
|||
cd vue-vben-admin |
|||
|
|||
pnpm install |
|||
|
|||
``` |
|||
|
|||
- 运行 |
|||
|
|||
```bash |
|||
pnpm serve |
|||
``` |
|||
|
|||
- 打包 |
|||
|
|||
```bash |
|||
pnpm build |
|||
``` |
|||
|
|||
## 更新日志 |
|||
|
|||
[CHANGELOG](./CHANGELOG.zh_CN.md) |
|||
|
|||
## 项目地址 |
|||
|
|||
- [vue-vben-admin](https://github.com/anncwb/vue-vben-admin) - 完整版 |
|||
- [vue-vben-admin-thin-next](https://github.com/anncwb/vben-admin-thin-next) - 简化版 |
|||
|
|||
## 如何贡献 |
|||
|
|||
非常欢迎你的加入 或者提交一个 Pull Request。 |
|||
|
|||
**Pull Request:** |
|||
|
|||
1. Fork 代码! |
|||
2. 创建自己的分支: `git checkout -b feat/xxxx` |
|||
3. 提交你的修改: `git commit -am 'feat(function): add xxxxx'` |
|||
4. 推送您的分支: `git push origin feat/xxxx` |
|||
5. 提交`pull request` |
|||
|
|||
## Git 贡献提交规范 |
|||
|
|||
- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) |
|||
|
|||
- `feat` 增加新功能 |
|||
- `fix` 修复问题/BUG |
|||
- `style` 代码风格相关无影响运行结果的 |
|||
- `perf` 优化/性能提升 |
|||
- `refactor` 重构 |
|||
- `revert` 撤销修改 |
|||
- `test` 测试相关 |
|||
- `docs` 文档/注释 |
|||
- `chore` 依赖更新/脚手架配置修改等 |
|||
- `workflow` 工作流改进 |
|||
- `ci` 持续集成 |
|||
- `types` 类型定义文件更改 |
|||
- `wip` 开发中 |
|||
|
|||
## 浏览器支持 |
|||
|
|||
本地开发推荐使用`Chrome 80+` 浏览器 |
|||
|
|||
支持现代浏览器, 不支持 IE |
|||
|
|||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | |
|||
| :-: | :-: | :-: | :-: | :-: | |
|||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions | |
|||
|
|||
## 相关仓库 |
|||
|
|||
如果这些插件对你有帮助,可以给一个 star 支持下 |
|||
|
|||
- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - 用于本地及开发环境数据 mock |
|||
- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - 用于 html 模版转换及压缩 |
|||
- [vite-plugin-style-import](https://github.com/anncwb/vite-plugin-style-import) - 用于组件库样式按需引入 |
|||
- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - 用于在线切换主题色等颜色相关配置 |
|||
- [vite-plugin-imagemin](https://github.com/anncwb/vite-plugin-imagemin) - 用于打包压缩图片资源 |
|||
- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - 用于打包输出.gz|.brotil 文件 |
|||
- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - 用于快速生成 svg 雪碧图 |
|||
|
|||
## 后台整合示例 |
|||
|
|||
- [lamp-cloud](https://github.com/zuihou/lamp-cloud) - 基于 SpringCloud Alibaba 的微服务中后台快速开发平台 |
|||
- [matecloud](https://github.com/matevip/matecloud) - MateCloud 微服务脚手架,基于 Spring Cloud 2020.0.3、SpringBoot 2.5.3 的全开源平台 |
|||
|
|||
## 维护者 |
|||
|
|||
[@Vben](https://github.com/anncwb) |
|||
|
|||
## 捐赠 |
|||
|
|||
如果你觉得这个项目对你有帮助,你可以帮作者买一杯咖啡表示支持! |
|||
|
|||
 |
|||
|
|||
<a style="display: block;width: 100px;height: 50px;line-height: 50px; color: #fff;text-align: center; background: #408aed;border-radius: 4px;" href="https://www.paypal.com/paypalme/cvvben">Paypal Me</a> |
|||
|
|||
## 交流 |
|||
|
|||
`Vue-vben-Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供 QQ 交流群使用问题欢迎在群内提问。 |
|||
|
|||
- QQ 群 `569291866` |
|||
|
|||
## License |
|||
|
|||
[MIT © Vben-2020](./LICENSE) |
|||
@ -0,0 +1,325 @@ |
|||
import { MockMethod } from 'vite-plugin-mock'; |
|||
import { resultSuccess } from '../_util'; |
|||
|
|||
const areaList: any[] = [ |
|||
{ |
|||
id: '530825900854620160', |
|||
code: '430000', |
|||
parentCode: '100000', |
|||
levelType: 1, |
|||
name: '湖南省', |
|||
province: '湖南省', |
|||
city: null, |
|||
district: null, |
|||
town: null, |
|||
village: null, |
|||
parentPath: '430000', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 16:33:42', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530825900883980288', |
|||
code: '430100', |
|||
parentCode: '430000', |
|||
levelType: 2, |
|||
name: '长沙市', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: null, |
|||
town: null, |
|||
village: null, |
|||
parentPath: '430000,430100', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 16:33:42', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530825900951089152', |
|||
code: '430102', |
|||
parentCode: '430100', |
|||
levelType: 3, |
|||
name: '芙蓉区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '芙蓉区', |
|||
town: null, |
|||
village: null, |
|||
parentPath: '430000,430100,430102', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 16:33:42', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530825901014003712', |
|||
code: '430104', |
|||
parentCode: '430100', |
|||
levelType: 3, |
|||
name: '岳麓区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '岳麓区', |
|||
town: null, |
|||
village: null, |
|||
parentPath: '430000,430100,430104', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 16:33:42', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530825900988837888', |
|||
code: '430103', |
|||
parentCode: '430100', |
|||
levelType: 3, |
|||
name: '天心区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: null, |
|||
village: null, |
|||
parentPath: '430000,430100,430103', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 16:33:42', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530826672489115648', |
|||
code: '430103002', |
|||
parentCode: '430103', |
|||
levelType: 4, |
|||
name: '坡子街街道', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: null, |
|||
parentPath: '430000,430100,430103,430103002', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-12-14 15:26:43', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241171607552', |
|||
code: '430103002001', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '八角亭社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '八角亭社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002001', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2021-01-20 14:07:23', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241200967680', |
|||
code: '430103002002', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '西牌楼社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '西牌楼社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002002', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241230327808', |
|||
code: '430103002003', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '太平街社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '太平街社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002003', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241259687936', |
|||
code: '430103002005', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '坡子街社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '坡子街社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002005', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241284853760', |
|||
code: '430103002006', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '青山祠社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '青山祠社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002006', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241310019584', |
|||
code: '430103002007', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '沙河社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '沙河社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002007', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241381322752', |
|||
code: '430103002008', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '碧湘社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '碧湘社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002008', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241410682880', |
|||
code: '430103002009', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '创远社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '创远社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002009', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241431654400', |
|||
code: '430103002010', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '楚湘社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '楚湘社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002010', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241465208832', |
|||
code: '430103002011', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '西湖社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '西湖社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002011', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241502957568', |
|||
code: '430103002012', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '登仁桥社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '登仁桥社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002012', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
{ |
|||
id: '530840241553289216', |
|||
code: '430103002013', |
|||
parentCode: '430103002', |
|||
levelType: 5, |
|||
name: '文庙坪社区', |
|||
province: '湖南省', |
|||
city: '长沙市', |
|||
district: '天心区', |
|||
town: '坡子街街道', |
|||
village: '文庙坪社区', |
|||
parentPath: '430000,430100,430103,430103002,430103002013', |
|||
createTime: '2020-11-30 15:47:31', |
|||
updateTime: '2020-11-30 17:30:41', |
|||
customized: false, |
|||
usable: true, |
|||
}, |
|||
]; |
|||
export default [ |
|||
{ |
|||
url: '/basic-api/cascader/getAreaRecord', |
|||
timeout: 1000, |
|||
method: 'post', |
|||
response: ({ body }) => { |
|||
const { parentCode } = body || {}; |
|||
if (!parentCode) { |
|||
return resultSuccess(areaList.filter((it) => it.code === '430000')); |
|||
} |
|||
return resultSuccess(areaList.filter((it) => it.parentCode === parentCode)); |
|||
}, |
|||
}, |
|||
] as MockMethod[]; |
|||
@ -0,0 +1,28 @@ |
|||
import { MockMethod } from 'vite-plugin-mock'; |
|||
import { resultSuccess } from '../_util'; |
|||
|
|||
const demoList = (keyword, count = 20) => { |
|||
const result = { |
|||
list: [] as any[], |
|||
}; |
|||
for (let index = 0; index < count; index++) { |
|||
result.list.push({ |
|||
name: `${keyword ?? ''}选项${index}`, |
|||
id: `${index}`, |
|||
}); |
|||
} |
|||
return result; |
|||
}; |
|||
|
|||
export default [ |
|||
{ |
|||
url: '/basic-api/select/getDemoOptions', |
|||
timeout: 1000, |
|||
method: 'get', |
|||
response: ({ query }) => { |
|||
const { keyword, count } = query; |
|||
console.log(keyword); |
|||
return resultSuccess(demoList(keyword, count)); |
|||
}, |
|||
}, |
|||
] as MockMethod[]; |
|||
@ -0,0 +1,202 @@ |
|||
import { MockMethod } from 'vite-plugin-mock'; |
|||
import { resultError, resultPageSuccess, resultSuccess } from '../_util'; |
|||
|
|||
const accountList = (() => { |
|||
const result: any[] = []; |
|||
for (let index = 0; index < 20; index++) { |
|||
result.push({ |
|||
id: `${index}`, |
|||
account: '@first', |
|||
email: '@email', |
|||
nickname: '@cname()', |
|||
role: '@first', |
|||
createTime: '@datetime', |
|||
remark: '@cword(10,20)', |
|||
'status|1': ['0', '1'], |
|||
}); |
|||
} |
|||
return result; |
|||
})(); |
|||
|
|||
const roleList = (() => { |
|||
const result: any[] = []; |
|||
for (let index = 0; index < 4; index++) { |
|||
result.push({ |
|||
id: index + 1, |
|||
orderNo: `${index + 1}`, |
|||
roleName: ['超级管理员', '管理员', '文章管理员', '普通用户'][index], |
|||
roleValue: '@first', |
|||
createTime: '@datetime', |
|||
remark: '@cword(10,20)', |
|||
menu: [['0', '1', '2'], ['0', '1'], ['0', '2'], ['2']][index], |
|||
'status|1': ['0', '1'], |
|||
}); |
|||
} |
|||
return result; |
|||
})(); |
|||
|
|||
const deptList = (() => { |
|||
const result: any[] = []; |
|||
for (let index = 0; index < 3; index++) { |
|||
result.push({ |
|||
id: `${index}`, |
|||
deptName: ['华东分部', '华南分部', '西北分部'][index], |
|||
orderNo: index + 1, |
|||
createTime: '@datetime', |
|||
remark: '@cword(10,20)', |
|||
'status|1': ['0', '0', '1'], |
|||
children: (() => { |
|||
const children: any[] = []; |
|||
for (let j = 0; j < 4; j++) { |
|||
children.push({ |
|||
id: `${index}-${j}`, |
|||
deptName: ['研发部', '市场部', '商务部', '财务部'][j], |
|||
orderNo: j + 1, |
|||
createTime: '@datetime', |
|||
remark: '@cword(10,20)', |
|||
'status|1': ['0', '1'], |
|||
parentDept: `${index}`, |
|||
children: undefined, |
|||
}); |
|||
} |
|||
return children; |
|||
})(), |
|||
}); |
|||
} |
|||
return result; |
|||
})(); |
|||
|
|||
const menuList = (() => { |
|||
const result: any[] = []; |
|||
for (let index = 0; index < 3; index++) { |
|||
result.push({ |
|||
id: `${index}`, |
|||
icon: ['ion:layers-outline', 'ion:git-compare-outline', 'ion:tv-outline'][index], |
|||
component: 'LAYOUT', |
|||
type: '0', |
|||
menuName: ['Dashboard', '权限管理', '功能'][index], |
|||
permission: '', |
|||
orderNo: index + 1, |
|||
createTime: '@datetime', |
|||
'status|1': ['0', '0', '1'], |
|||
children: (() => { |
|||
const children: any[] = []; |
|||
for (let j = 0; j < 4; j++) { |
|||
children.push({ |
|||
id: `${index}-${j}`, |
|||
type: '1', |
|||
menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j], |
|||
icon: 'ion:document', |
|||
permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index], |
|||
component: [ |
|||
'/dashboard/welcome/index', |
|||
'/dashboard/analysis/index', |
|||
'/dashboard/workbench/index', |
|||
'/dashboard/test/index', |
|||
][j], |
|||
orderNo: j + 1, |
|||
createTime: '@datetime', |
|||
'status|1': ['0', '1'], |
|||
parentMenu: `${index}`, |
|||
children: (() => { |
|||
const children: any[] = []; |
|||
for (let k = 0; k < 4; k++) { |
|||
children.push({ |
|||
id: `${index}-${j}-${k}`, |
|||
type: '2', |
|||
menuName: '按钮' + (j + 1) + '-' + (k + 1), |
|||
icon: '', |
|||
permission: |
|||
['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index] + |
|||
':btn' + |
|||
(k + 1), |
|||
component: [ |
|||
'/dashboard/welcome/index', |
|||
'/dashboard/analysis/index', |
|||
'/dashboard/workbench/index', |
|||
'/dashboard/test/index', |
|||
][j], |
|||
orderNo: j + 1, |
|||
createTime: '@datetime', |
|||
'status|1': ['0', '1'], |
|||
parentMenu: `${index}-${j}`, |
|||
children: undefined, |
|||
}); |
|||
} |
|||
return children; |
|||
})(), |
|||
}); |
|||
} |
|||
return children; |
|||
})(), |
|||
}); |
|||
} |
|||
return result; |
|||
})(); |
|||
|
|||
export default [ |
|||
{ |
|||
url: '/basic-api/system/getAccountList', |
|||
timeout: 100, |
|||
method: 'get', |
|||
response: ({ query }) => { |
|||
const { page = 1, pageSize = 20 } = query; |
|||
return resultPageSuccess(page, pageSize, accountList); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/basic-api/system/getRoleListByPage', |
|||
timeout: 100, |
|||
method: 'get', |
|||
response: ({ query }) => { |
|||
const { page = 1, pageSize = 20 } = query; |
|||
return resultPageSuccess(page, pageSize, roleList); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/basic-api/system/setRoleStatus', |
|||
timeout: 500, |
|||
method: 'post', |
|||
response: ({ query }) => { |
|||
const { id, status } = query; |
|||
return resultSuccess({ id, status }); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/basic-api/system/getAllRoleList', |
|||
timeout: 100, |
|||
method: 'get', |
|||
response: () => { |
|||
return resultSuccess(roleList); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/basic-api/system/getDeptList', |
|||
timeout: 100, |
|||
method: 'get', |
|||
response: () => { |
|||
return resultSuccess(deptList); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/basic-api/system/getMenuList', |
|||
timeout: 100, |
|||
method: 'get', |
|||
response: () => { |
|||
return resultSuccess(menuList); |
|||
}, |
|||
}, |
|||
{ |
|||
url: '/basic-api/system/accountExist', |
|||
timeout: 500, |
|||
method: 'post', |
|||
response: ({ body }) => { |
|||
const { account } = body || {}; |
|||
if (account && account.indexOf('admin') !== -1) { |
|||
return resultError('该字段不能包含admin'); |
|||
} else { |
|||
return resultSuccess(`${account} can use`); |
|||
} |
|||
}, |
|||
}, |
|||
] as MockMethod[]; |
|||
@ -0,0 +1,52 @@ |
|||
import { MockMethod } from 'vite-plugin-mock'; |
|||
import { Random } from 'mockjs'; |
|||
import { resultPageSuccess } from '../_util'; |
|||
|
|||
function getRandomPics(count = 10): string[] { |
|||
const arr: string[] = []; |
|||
for (let i = 0; i < count; i++) { |
|||
arr.push(Random.image('800x600', Random.color(), Random.color(), Random.title())); |
|||
} |
|||
return arr; |
|||
} |
|||
|
|||
const demoList = (() => { |
|||
const result: any[] = []; |
|||
for (let index = 0; index < 200; index++) { |
|||
result.push({ |
|||
id: `${index}`, |
|||
beginTime: '@datetime', |
|||
endTime: '@datetime', |
|||
address: '@city()', |
|||
name: '@cname()', |
|||
name1: '@cname()', |
|||
name2: '@cname()', |
|||
name3: '@cname()', |
|||
name4: '@cname()', |
|||
name5: '@cname()', |
|||
name6: '@cname()', |
|||
name7: '@cname()', |
|||
name8: '@cname()', |
|||
avatar: Random.image('400x400', Random.color(), Random.color(), Random.first()), |
|||
imgArr: getRandomPics(Math.ceil(Math.random() * 3) + 1), |
|||
imgs: getRandomPics(Math.ceil(Math.random() * 3) + 1), |
|||
date: `@date('yyyy-MM-dd')`, |
|||
time: `@time('HH:mm')`, |
|||
'no|100000-10000000': 100000, |
|||
'status|1': ['normal', 'enable', 'disable'], |
|||
}); |
|||
} |
|||
return result; |
|||
})(); |
|||
|
|||
export default [ |
|||
{ |
|||
url: '/basic-api/table/getDemoList', |
|||
timeout: 100, |
|||
method: 'get', |
|||
response: ({ query }) => { |
|||
const { page = 1, pageSize = 20 } = query; |
|||
return resultPageSuccess(page, pageSize, demoList); |
|||
}, |
|||
}, |
|||
] as MockMethod[]; |
|||
@ -0,0 +1,38 @@ |
|||
import { MockMethod } from 'vite-plugin-mock'; |
|||
import { resultSuccess } from '../_util'; |
|||
|
|||
const demoTreeList = (keyword) => { |
|||
const result = { |
|||
list: [] as Recordable[], |
|||
}; |
|||
for (let index = 0; index < 5; index++) { |
|||
const children: Recordable[] = []; |
|||
for (let j = 0; j < 3; j++) { |
|||
children.push({ |
|||
title: `${keyword ?? ''}选项${index}-${j}`, |
|||
value: `${index}-${j}`, |
|||
key: `${index}-${j}`, |
|||
}); |
|||
} |
|||
result.list.push({ |
|||
title: `${keyword ?? ''}选项${index}`, |
|||
value: `${index}`, |
|||
key: `${index}`, |
|||
children, |
|||
}); |
|||
} |
|||
return result; |
|||
}; |
|||
|
|||
export default [ |
|||
{ |
|||
url: '/basic-api/tree/getDemoOptions', |
|||
timeout: 1000, |
|||
method: 'get', |
|||
response: ({ query }) => { |
|||
const { keyword } = query; |
|||
console.log(keyword); |
|||
return resultSuccess(demoTreeList(keyword)); |
|||
}, |
|||
}, |
|||
] as MockMethod[]; |
|||
@ -1,89 +0,0 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
AggregateRoute, |
|||
CreateAggregateRoute, |
|||
CreateAggregateRouteConfig, |
|||
UpdateAggregateRoute, |
|||
GetAggregateRoutePagedRequest, |
|||
AggregateRoutePagedResult, |
|||
} from './model/aggregateModel'; |
|||
import { format } from '/@/utils/strings'; |
|||
|
|||
enum Api { |
|||
RemoteService = 'ApiGateway', |
|||
Controller = 'AggregateReRoute', |
|||
GetById = '/api/ApiGateway/Aggregates/{routeId}', |
|||
GetList = '/api/ApiGateway/Globals', |
|||
GetActivedList = '/api/ApiGateway/RouteGroups/Actived', |
|||
} |
|||
|
|||
export const create = (input: CreateAggregateRoute) => { |
|||
return defAbpHttp.request<AggregateRoute>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'CreateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const createConfig = (input: CreateAggregateRouteConfig) => { |
|||
return defAbpHttp.request<AggregateRoute>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'AddRouteConfigAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteById = (routeId: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
input: { |
|||
RouteId: routeId, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteConfig = (routeId: string, routeKey: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
input: { |
|||
RouteId: routeId, |
|||
ReRouteKey: routeKey, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getById = (id: string) => { |
|||
return defAbpHttp.get<AggregateRoute>({ |
|||
url: format(Api.GetById, { routeId: id }), |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: GetAggregateRoutePagedRequest) => { |
|||
return defAbpHttp.request<AggregateRoutePagedResult>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'GetPagedListAsync', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: UpdateAggregateRoute) => { |
|||
return defAbpHttp.request<AggregateRoute>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
@ -1,26 +0,0 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { LoadBalancerDescriptor } from './model/basicModel'; |
|||
import { ListResultDto } from '../model/baseModel'; |
|||
|
|||
enum Api { |
|||
GetLoadBalancerProviders = '/api/ApiGateway/Basic/LoadBalancers', |
|||
GetDefinedAggregatorProvicers = '/api/ApiGateway/Basic/Aggregators', |
|||
} |
|||
|
|||
export const getLoadBalancerProviders = () => { |
|||
return defAbpHttp.get<ListResultDto<LoadBalancerDescriptor>>({ |
|||
url: Api.GetLoadBalancerProviders, |
|||
}); |
|||
}; |
|||
|
|||
export async function getDefinedAggregatorProviders() { |
|||
const { items } = await defAbpHttp.get<ListResultDto<string>>({ |
|||
url: Api.GetDefinedAggregatorProvicers, |
|||
}); |
|||
// 需要对返回格式转换以适配 ApiSelect组件
|
|||
return items.map((item) => { |
|||
return { |
|||
provider: item, |
|||
}; |
|||
}); |
|||
} |
|||
@ -1,66 +0,0 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
GlobalConfiguration, |
|||
CreateGlobalConfiguration, |
|||
UpdateGlobalConfiguration, |
|||
GetGlobalPagedRequest, |
|||
GlobalConfigurationPagedResult, |
|||
} from './model/globalModel'; |
|||
|
|||
enum Api { |
|||
RemoteService = 'ApiGateway', |
|||
Controller = 'GlobalConfiguration', |
|||
GetList = '/api/ApiGateway/Globals', |
|||
GetActivedList = '/api/ApiGateway/RouteGroups/Actived', |
|||
} |
|||
|
|||
export const create = (input: CreateGlobalConfiguration) => { |
|||
return defAbpHttp.request<GlobalConfiguration>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'CreateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: UpdateGlobalConfiguration) => { |
|||
return defAbpHttp.request<GlobalConfiguration>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getByAppId = (appId: string) => { |
|||
return defAbpHttp.request<GlobalConfiguration>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'GetAsync', |
|||
params: { |
|||
input: { |
|||
appId: appId, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: GetGlobalPagedRequest) => { |
|||
return defAbpHttp.get<GlobalConfigurationPagedResult>({ |
|||
url: Api.GetList, |
|||
params: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteByAppId = (appId: string) => { |
|||
return defAbpHttp.request<GlobalConfiguration>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
input: { |
|||
appId: appId, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
@ -1,73 +0,0 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
RouteGroup, |
|||
CreateRouteGroup, |
|||
UpdateRouteGroup, |
|||
RouteGroupListResult, |
|||
GetRouteGroupPagedRequest, |
|||
RouteGroupPagedResult, |
|||
} from './model/groupModel'; |
|||
|
|||
enum Api { |
|||
RemoteService = 'ApiGateway', |
|||
Controller = 'RouteGroup', |
|||
GetList = '/api/ApiGateway/RouteGroups', |
|||
GetActivedList = '/api/ApiGateway/RouteGroups/Actived', |
|||
} |
|||
|
|||
export const create = (input: CreateRouteGroup) => { |
|||
return defAbpHttp.request<RouteGroup>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'CreateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: UpdateRouteGroup) => { |
|||
return defAbpHttp.request<RouteGroup>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getByAppId = (appId: string) => { |
|||
return defAbpHttp.request<RouteGroup>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'GetAsync', |
|||
params: { |
|||
input: { |
|||
appId: appId, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getActivedList = () => { |
|||
return defAbpHttp.get<RouteGroupListResult>({ |
|||
url: Api.GetList, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: GetRouteGroupPagedRequest) => { |
|||
return defAbpHttp.get<RouteGroupPagedResult>({ |
|||
url: Api.GetList, |
|||
params: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteByAppId = (appId: string) => { |
|||
return defAbpHttp.request<RouteGroup>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
input: { |
|||
appId: appId, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
@ -1,46 +0,0 @@ |
|||
import { PagedAndSortedResultRequestDto, PagedResultDto } from '../../model/baseModel'; |
|||
|
|||
export class AggregateRouteConfig { |
|||
reRouteKey = ''; |
|||
parameter = ''; |
|||
jsonPath = ''; |
|||
} |
|||
|
|||
export class CreateAggregateRouteConfig extends AggregateRouteConfig { |
|||
routeId = ''; |
|||
} |
|||
|
|||
export class AggregateRouteBase { |
|||
reRouteKeys: string[] = []; |
|||
upstreamPathTemplate = ''; |
|||
upstreamHost = ''; |
|||
reRouteIsCaseSensitive = true; |
|||
aggregator = ''; |
|||
priority?: number; |
|||
upstreamHttpMethod: string[] = []; |
|||
} |
|||
|
|||
export class AggregateRoute extends AggregateRouteBase { |
|||
appId = ''; |
|||
name = ''; |
|||
reRouteId = ''; |
|||
concurrencyStamp = ''; |
|||
reRouteKeysConfig: AggregateRouteConfig[] = []; |
|||
} |
|||
|
|||
export class CreateAggregateRoute extends AggregateRouteBase { |
|||
appId = ''; |
|||
name = ''; |
|||
} |
|||
|
|||
export class UpdateAggregateRoute extends AggregateRouteBase { |
|||
routeId = ''; |
|||
concurrencyStamp = ''; |
|||
} |
|||
|
|||
export class GetAggregateRoutePagedRequest extends PagedAndSortedResultRequestDto { |
|||
appId = ''; |
|||
filter = ''; |
|||
} |
|||
|
|||
export class AggregateRoutePagedResult extends PagedResultDto<AggregateRoute> {} |
|||
@ -1,80 +0,0 @@ |
|||
export class ServiceDiscoveryProvider { |
|||
host!: string; |
|||
port?: number; |
|||
type!: string; |
|||
token?: string; |
|||
configurationKey?: string; |
|||
pollingInterval?: number; |
|||
namespace?: string; |
|||
scheme?: string; |
|||
} |
|||
|
|||
export class RateLimitOptions { |
|||
clientIdHeader?: string; |
|||
httpStatusCode?: number; |
|||
quotaExceededMessage?: string; |
|||
rateLimitCounterPrefix?: string; |
|||
disableRateLimitHeaders!: boolean; |
|||
} |
|||
|
|||
export class RateLimitRuleOptions { |
|||
clientWhitelist?: string[] = []; |
|||
enableRateLimiting!: boolean; |
|||
period?: string; |
|||
periodTimespan?: boolean; |
|||
limit?: number; |
|||
} |
|||
|
|||
export class QoSOptions { |
|||
timeoutValue?: number = 10000; |
|||
durationOfBreak?: number = 60000; |
|||
exceptionsAllowedBeforeBreaking?: number = 50; |
|||
} |
|||
|
|||
export class LoadBalancerOptions { |
|||
type?: string = ''; |
|||
key?: string = ''; |
|||
expiry?: number = 0; |
|||
} |
|||
|
|||
export class HostAndPort { |
|||
host = ''; |
|||
port?: number = 80; |
|||
} |
|||
|
|||
export class HttpHandlerOptions { |
|||
useProxy = false; |
|||
useTracing = false; |
|||
allowAutoRedirect = false; |
|||
useCookieContainer = false; |
|||
maxConnectionsPerServer?: number = 0; |
|||
} |
|||
|
|||
export class FileCacheOptions { |
|||
ttlSeconds?: number = 0; |
|||
region?: string = ''; |
|||
} |
|||
|
|||
export class AuthenticationOptions { |
|||
authenticationProviderKey?: string = ''; |
|||
allowedScopes?: string[] = []; |
|||
} |
|||
|
|||
export class SecurityOptions { |
|||
ipAllowedList?: string[] = []; |
|||
ipBlockedList?: string[] = []; |
|||
} |
|||
|
|||
export class LoadBalancerDescriptor { |
|||
type!: string; |
|||
displayName!: string; |
|||
} |
|||
|
|||
export const HttpMethods: { [key: string]: string } = { |
|||
['GET']: 'blue', |
|||
['POST']: 'green', |
|||
['PUT']: 'orange', |
|||
['DELETE']: 'red', |
|||
['OPTIONS']: 'cyan', |
|||
['PATCH']: 'pink', |
|||
}; |
|||
@ -1,39 +0,0 @@ |
|||
import { PagedAndSortedResultRequestDto, PagedResultDto } from '../../model/baseModel'; |
|||
import { |
|||
HttpHandlerOptions, |
|||
LoadBalancerOptions, |
|||
QoSOptions, |
|||
RateLimitOptions, |
|||
ServiceDiscoveryProvider, |
|||
} from './basicModel'; |
|||
|
|||
export class GlobalConfigurationBase { |
|||
baseUrl = ''; |
|||
requestIdKey?: string = ''; |
|||
downstreamScheme?: string = ''; |
|||
downstreamHttpVersion?: string = ''; |
|||
qoSOptions!: QoSOptions; |
|||
rateLimitOptions!: RateLimitOptions; |
|||
httpHandlerOptions!: HttpHandlerOptions; |
|||
loadBalancerOptions!: LoadBalancerOptions; |
|||
serviceDiscoveryProvider!: ServiceDiscoveryProvider; |
|||
} |
|||
|
|||
export class GlobalConfiguration extends GlobalConfigurationBase { |
|||
appId!: string; |
|||
itemId!: string; |
|||
} |
|||
|
|||
export class CreateGlobalConfiguration extends GlobalConfigurationBase { |
|||
appId = ''; |
|||
} |
|||
|
|||
export class UpdateGlobalConfiguration extends GlobalConfigurationBase { |
|||
itemId!: string; |
|||
} |
|||
|
|||
export class GetGlobalPagedRequest extends PagedAndSortedResultRequestDto { |
|||
filter = ''; |
|||
} |
|||
|
|||
export class GlobalConfigurationPagedResult extends PagedResultDto<GlobalConfiguration> {} |
|||
@ -1,38 +0,0 @@ |
|||
import { |
|||
FullAuditedEntityDto, |
|||
ListResultDto, |
|||
PagedAndSortedResultRequestDto, |
|||
PagedResultDto, |
|||
} from '../../model/baseModel'; |
|||
|
|||
export class RouteGroup extends FullAuditedEntityDto { |
|||
id!: string; |
|||
name!: string; |
|||
appId!: string; |
|||
appName!: string; |
|||
appIpAddress?: string; |
|||
description?: string; |
|||
isActive!: boolean; |
|||
} |
|||
|
|||
export class CreateOrUpdateRouteGroup { |
|||
name = ''; |
|||
appId = ''; |
|||
appName = ''; |
|||
isActive = true; |
|||
appIpAddress?: string = ''; |
|||
description?: string = ''; |
|||
} |
|||
|
|||
export class CreateRouteGroup extends CreateOrUpdateRouteGroup {} |
|||
|
|||
export class UpdateRouteGroup extends CreateOrUpdateRouteGroup {} |
|||
|
|||
export class GetRouteGroupPagedRequest extends PagedAndSortedResultRequestDto { |
|||
filter = ''; |
|||
sorting = 'AppId'; |
|||
} |
|||
|
|||
export class RouteGroupPagedResult extends PagedResultDto<RouteGroup> {} |
|||
|
|||
export class RouteGroupListResult extends ListResultDto<RouteGroup> {} |
|||
@ -1,70 +0,0 @@ |
|||
import { PagedAndSortedResultRequestDto, PagedResultDto } from '../../model/baseModel'; |
|||
import { |
|||
AuthenticationOptions, |
|||
FileCacheOptions, |
|||
HostAndPort, |
|||
HttpHandlerOptions, |
|||
LoadBalancerOptions, |
|||
QoSOptions, |
|||
RateLimitRuleOptions, |
|||
SecurityOptions, |
|||
} from './basicModel'; |
|||
|
|||
export class RouteBase { |
|||
reRouteName = ''; // TODO: 需要修改名称
|
|||
downstreamPathTemplate = ''; |
|||
changeDownstreamPathTemplate?: { [key: string]: string }; |
|||
upstreamPathTemplate = ''; |
|||
upstreamHttpMethod!: string[]; |
|||
addHeadersToRequest?: { [key: string]: string }; |
|||
upstreamHeaderTransform?: { [key: string]: string }; |
|||
downstreamHeaderTransform?: { [key: string]: string }; |
|||
addClaimsToRequest?: { [key: string]: string }; |
|||
routeClaimsRequirement?: { [key: string]: string }; |
|||
addQueriesToRequest?: { [key: string]: string }; |
|||
requestIdKey? = ''; |
|||
reRouteIsCaseSensitive? = true; |
|||
serviceName? = ''; |
|||
serviceNamespace? = ''; |
|||
downstreamScheme? = 'HTTP'; |
|||
downstreamHostAndPorts!: HostAndPort[]; |
|||
upstreamHost = ''; |
|||
key? = ''; |
|||
delegatingHandlers?: string[]; |
|||
priority? = 0; |
|||
timeout? = 30000; |
|||
dangerousAcceptAnyServerCertificateValidator?: boolean = true; |
|||
downstreamHttpVersion? = ''; |
|||
downstreamHttpMethod? = ''; |
|||
securityOptions?: SecurityOptions; |
|||
qoSOptions?: QoSOptions; |
|||
rateLimitOptions?: RateLimitRuleOptions; |
|||
loadBalancerOptions?: LoadBalancerOptions; |
|||
fileCacheOptions?: FileCacheOptions; |
|||
authenticationOptions?: AuthenticationOptions; |
|||
httpHandlerOptions?: HttpHandlerOptions; |
|||
} |
|||
|
|||
export class Route extends RouteBase { |
|||
id!: number; |
|||
appId!: string; |
|||
reRouteId!: string; |
|||
concurrencyStamp!: string; |
|||
} |
|||
|
|||
export class CreateRoute extends RouteBase { |
|||
appId = ''; |
|||
} |
|||
|
|||
export class UpdateRoute extends RouteBase { |
|||
reRouteId = ''; |
|||
concurrencyStamp!: string; |
|||
} |
|||
|
|||
export class GetRoutePagedRequest extends PagedAndSortedResultRequestDto { |
|||
appId!: string; |
|||
filter = ''; |
|||
sorting = 'ReRouteName'; |
|||
} |
|||
|
|||
export class RoutePagedResult extends PagedResultDto<Route> {} |
|||
@ -1,70 +0,0 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
Route, |
|||
CreateRoute, |
|||
UpdateRoute, |
|||
GetRoutePagedRequest, |
|||
RoutePagedResult, |
|||
} from './model/routeModel'; |
|||
|
|||
enum Api { |
|||
RemoteService = 'ApiGateway', |
|||
Controller = 'ReRoute', |
|||
GetList = '/api/ApiGateway/Globals', |
|||
GetActivedList = '/api/ApiGateway/RouteGroups/Actived', |
|||
} |
|||
|
|||
export const create = (input: CreateRoute) => { |
|||
return defAbpHttp.request<Route>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'CreateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
input: { |
|||
RouteId: id, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getById = (id: string) => { |
|||
return defAbpHttp.request<Route>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'GetAsync', |
|||
params: { |
|||
input: { |
|||
RouteId: id, |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: GetRoutePagedRequest) => { |
|||
return defAbpHttp.request<RoutePagedResult>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'GetListAsync', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: UpdateRoute) => { |
|||
return defAbpHttp.request<Route>({ |
|||
service: Api.RemoteService, |
|||
controller: Api.Controller, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,56 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
CacheKeys, |
|||
CacheValue, |
|||
CacheRefreshRequest, |
|||
GetCacheKeysRequest, |
|||
} from './model'; |
|||
|
|||
const remoteServiceName = 'CachingManagement'; |
|||
const controllerName = 'Cache'; |
|||
|
|||
export const getKeys = (input: GetCacheKeysRequest) => { |
|||
return defAbpHttp.request<CacheKeys>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetKeysAsync', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getValue = (key: string) => { |
|||
return defAbpHttp.request<CacheValue>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetValueAsync', |
|||
params: { |
|||
input: { |
|||
key: key, |
|||
} |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const refresh = (input: CacheRefreshRequest) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'RefreshAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const remove = (key: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'RemoveAsync', |
|||
params: { |
|||
input: { |
|||
key: key, |
|||
} |
|||
}, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,23 @@ |
|||
export interface CacheKeys { |
|||
nextMarker: string; |
|||
keys: string[], |
|||
} |
|||
|
|||
export interface CacheValue { |
|||
type: string; |
|||
size: number; |
|||
expiration?: Date; |
|||
values: {[key:string]: any}; |
|||
} |
|||
|
|||
export interface CacheRefreshRequest { |
|||
key: string; |
|||
absoluteExpiration?: Date; |
|||
slidingExpiration?: Date; |
|||
} |
|||
|
|||
export interface GetCacheKeysRequest { |
|||
prefix?: string; |
|||
marker?: string; |
|||
filter?: string; |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
import { defHttp } from '/@/utils/http/axios'; |
|||
|
|||
enum Api { |
|||
// The address does not exist
|
|||
Error = '/error', |
|||
} |
|||
|
|||
/** |
|||
* @description: Trigger ajax error |
|||
*/ |
|||
|
|||
export const fireErrorApi = () => defHttp.get({ url: Api.Error }); |
|||
@ -1,56 +1,12 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
Language, |
|||
LanguageCreateOrUpdate, |
|||
GetLanguagePagedRequest, |
|||
LanguageListResult, |
|||
LanguagePagedResult, |
|||
} from './model/languagesModel'; |
|||
import { format } from '/@/utils/strings'; |
|||
import { LanguageListResult } from './model/languagesModel'; |
|||
|
|||
enum Api { |
|||
Create = '/api/localization/languages', |
|||
DeleteById = '/api/localization/languages/{id}', |
|||
GetById = '/api/localization/languages/{id}', |
|||
GetList = '/api/localization/languages', |
|||
GetAllList = '/api/localization/languages/all', |
|||
GetList = '/api/abp/localization/languages', |
|||
} |
|||
|
|||
export const get = (id: string) => { |
|||
return defAbpHttp.get<Language>({ |
|||
url: format(Api.GetById, { id: id }), |
|||
}); |
|||
}; |
|||
|
|||
export const create = (input: LanguageCreateOrUpdate) => { |
|||
return defAbpHttp.post<Language>({ |
|||
url: Api.Create, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.delete<void>({ |
|||
url: format(Api.GetById, { id: id }), |
|||
}); |
|||
}; |
|||
|
|||
export const update = (id: string, input: LanguageCreateOrUpdate) => { |
|||
return defAbpHttp.put<Language>({ |
|||
url: format(Api.GetById, { id: id }), |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: GetLanguagePagedRequest) => { |
|||
return defAbpHttp.get<LanguagePagedResult>({ |
|||
url: Api.GetList, |
|||
params: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getAll = () => { |
|||
export const getList = () => { |
|||
return defAbpHttp.get<LanguageListResult>({ |
|||
url: Api.GetAllList, |
|||
url: Api.GetList, |
|||
}); |
|||
}; |
|||
|
|||
@ -1,56 +1,12 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
Resource, |
|||
ResourceCreateOrUpdate, |
|||
GetResourcePagedRequest, |
|||
ResourceListResult, |
|||
ResourcePagedResult, |
|||
} from './model/resourcesModel'; |
|||
import { format } from '/@/utils/strings'; |
|||
import { ResourceListResult } from './model/resourcesModel'; |
|||
|
|||
enum Api { |
|||
Create = '/api/localization/resources', |
|||
DeleteById = '/api/localization/resources/{id}', |
|||
GetById = '/api/localization/resources/{id}', |
|||
GetList = '/api/localization/resources', |
|||
GetAllList = '/api/localization/resources/all', |
|||
GetList = '/api/abp/localization/resources', |
|||
} |
|||
|
|||
export const get = (id: string) => { |
|||
return defAbpHttp.get<Resource>({ |
|||
url: format(Api.GetById, { id: id }), |
|||
}); |
|||
}; |
|||
|
|||
export const create = (input: ResourceCreateOrUpdate) => { |
|||
return defAbpHttp.post<Resource>({ |
|||
url: Api.Create, |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.delete<void>({ |
|||
url: format(Api.GetById, { id: id }), |
|||
}); |
|||
}; |
|||
|
|||
export const update = (id: string, input: ResourceCreateOrUpdate) => { |
|||
return defAbpHttp.put<Resource>({ |
|||
url: format(Api.GetById, { id: id }), |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: GetResourcePagedRequest) => { |
|||
return defAbpHttp.get<ResourcePagedResult>({ |
|||
url: Api.GetList, |
|||
params: input, |
|||
}); |
|||
}; |
|||
|
|||
export const getAll = () => { |
|||
export const getList = () => { |
|||
return defAbpHttp.get<ResourceListResult>({ |
|||
url: Api.GetAllList, |
|||
url: Api.GetList, |
|||
}); |
|||
}; |
|||
|
|||
@ -0,0 +1,71 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
OpenIddictApplicationDto, |
|||
OpenIddictApplicationCreateDto, |
|||
OpenIddictApplicationUpdateDto, |
|||
OpenIddictApplicationGetListInput, |
|||
} from './model'; |
|||
import { PagedResultDto } from '../../model/baseModel'; |
|||
|
|||
const remoteServiceName = 'AbpOpenIddict'; |
|||
const controllerName = 'OpenIddictApplication'; |
|||
|
|||
export const getById = (id: string) => { |
|||
return defAbpHttp.request<OpenIddictApplicationDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: OpenIddictApplicationGetListInput) => { |
|||
return defAbpHttp.get<PagedResultDto<OpenIddictApplicationDto>>({ |
|||
url: '/api/openiddict/applications', |
|||
params: input, |
|||
}, { |
|||
withToken: false |
|||
}); |
|||
}; |
|||
|
|||
// export const getList = (input: OpenIddictApplicationGetListInput) => {
|
|||
// return defAbpHttp.pagedRequest<OpenIddictApplicationDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetListAsync',
|
|||
// params: {
|
|||
// input: input,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const create = (input: OpenIddictApplicationCreateDto) => { |
|||
return defAbpHttp.request<OpenIddictApplicationDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'CreateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: OpenIddictApplicationUpdateDto) => { |
|||
return defAbpHttp.request<OpenIddictApplicationDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,47 @@ |
|||
import { ExtensibleObject, ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; |
|||
|
|||
export interface OpenIddictApplicationDto extends ExtensibleAuditedEntity<string> { |
|||
clientId: string; |
|||
clientSecret?: string; |
|||
consentType?: string; |
|||
displayName?: string; |
|||
displayNames?: {[key: string]: string}; |
|||
endpoints?: string[]; |
|||
grantTypes?: string[]; |
|||
responseTypes?: string[]; |
|||
scopes?: string[]; |
|||
postLogoutRedirectUris?: string[]; |
|||
properties?: {[key: string]: string}; |
|||
redirectUris?: string[]; |
|||
requirements?: string[]; |
|||
type?: string; |
|||
clientUri?: string; |
|||
logoUri?: string; |
|||
} |
|||
|
|||
export interface OpenIddictApplicationGetListInput extends PagedAndSortedResultRequestDto { |
|||
filter?: string; |
|||
} |
|||
|
|||
interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject { |
|||
clientId: string; |
|||
clientSecret?: string; |
|||
consentType?: string; |
|||
displayName?: string; |
|||
displayNames?: {[key: string]: string}; |
|||
endpoints?: string[]; |
|||
grantTypes?: string[]; |
|||
responseTypes?: string[]; |
|||
scopes?: string[]; |
|||
postLogoutRedirectUris?: string[]; |
|||
properties?: {[key: string]: string}; |
|||
redirectUris?: string[]; |
|||
requirements?: string[]; |
|||
type?: string; |
|||
clientUri?: string; |
|||
logoUri?: string; |
|||
} |
|||
|
|||
export type OpenIddictApplicationCreateDto = OpenIddictApplicationCreateOrUpdateDto; |
|||
|
|||
export type OpenIddictApplicationUpdateDto = OpenIddictApplicationCreateOrUpdateDto; |
|||
@ -0,0 +1,51 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
OpenIddictAuthorizationDto, |
|||
OpenIddictAuthorizationGetListInput, |
|||
} from './model'; |
|||
import { PagedResultDto } from '../../model/baseModel'; |
|||
|
|||
const remoteServiceName = 'AbpOpenIddict'; |
|||
const controllerName = 'OpenIddictAuthorization'; |
|||
|
|||
export const getById = (id: string) => { |
|||
return defAbpHttp.request<OpenIddictAuthorizationDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
// export const getList = (input: OpenIddictAuthorizationGetListInput) => {
|
|||
// return defAbpHttp.pagedRequest<OpenIddictAuthorizationDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetListAsync',
|
|||
// params: {
|
|||
// input: input,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const getList = (input: OpenIddictAuthorizationGetListInput) => { |
|||
return defAbpHttp.get<PagedResultDto<OpenIddictAuthorizationDto>>({ |
|||
url: '/api/openiddict/authorizations', |
|||
params: input, |
|||
}, { |
|||
withToken: false |
|||
}); |
|||
}; |
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,21 @@ |
|||
import { ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; |
|||
|
|||
export interface OpenIddictAuthorizationDto extends ExtensibleAuditedEntity<string> { |
|||
applicationId?: string; |
|||
creationDate?: Date; |
|||
properties?: {[key: string]: string}; |
|||
scopes?: string[]; |
|||
type?: string; |
|||
status?: string; |
|||
subject?: string; |
|||
} |
|||
|
|||
export interface OpenIddictAuthorizationGetListInput extends PagedAndSortedResultRequestDto { |
|||
filter?: string; |
|||
subject?: string; |
|||
clientId?: string; |
|||
status?: string; |
|||
type?: string; |
|||
beginCreationTime?: Date; |
|||
endCreationTime?: string; |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
OpenIddictScopeDto, |
|||
OpenIddictScopeCreateDto, |
|||
OpenIddictScopeUpdateDto, |
|||
OpenIddictScopeGetListInput, |
|||
} from './model'; |
|||
|
|||
const remoteServiceName = 'AbpOpenIddict'; |
|||
const controllerName = 'OpenIddictScope'; |
|||
|
|||
export const getById = (id: string) => { |
|||
return defAbpHttp.request<OpenIddictScopeDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getList = (input: OpenIddictScopeGetListInput) => { |
|||
return defAbpHttp.pagedRequest<OpenIddictScopeDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetListAsync', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'DeleteAsync', |
|||
params: { |
|||
id: id, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const create = (input: OpenIddictScopeCreateDto) => { |
|||
return defAbpHttp.request<OpenIddictScopeDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'CreateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: OpenIddictScopeUpdateDto) => { |
|||
return defAbpHttp.request<OpenIddictScopeDto>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,29 @@ |
|||
import { ExtensibleObject, ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; |
|||
|
|||
export interface OpenIddictScopeDto extends ExtensibleAuditedEntity<string> { |
|||
name: string; |
|||
displayName?: string; |
|||
displayNames?: {[key: string]: string}; |
|||
description?: string; |
|||
descriptions?: {[key: string]: string}; |
|||
properties?: {[key: string]: string}; |
|||
resources?: {[key: string]: string}; |
|||
} |
|||
|
|||
export interface OpenIddictScopeGetListInput extends PagedAndSortedResultRequestDto { |
|||
filter?: string; |
|||
} |
|||
|
|||
interface OpenIddictScopeCreateOrUpdateDto extends ExtensibleObject { |
|||
name: string; |
|||
displayName?: string; |
|||
displayNames?: {[key: string]: string}; |
|||
description?: string; |
|||
descriptions?: {[key: string]: string}; |
|||
properties?: {[key: string]: string}; |
|||
resources?: {[key: string]: string}; |
|||
} |
|||
|
|||
export type OpenIddictScopeCreateDto = OpenIddictScopeCreateOrUpdateDto; |
|||
|
|||
export type OpenIddictScopeUpdateDto = OpenIddictScopeCreateOrUpdateDto; |
|||
@ -0,0 +1,68 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
OpenIddictTokenDto, |
|||
OpenIddictTokenGetListInput, |
|||
} from './model'; |
|||
import { PagedResultDto } from '../../model/baseModel'; |
|||
|
|||
const remoteServiceName = 'AbpOpenIddict'; |
|||
const controllerName = 'OpenIddictToken'; |
|||
|
|||
// export const getById = (id: string) => {
|
|||
// return defAbpHttp.request<OpenIddictTokenDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetAsync',
|
|||
// params: {
|
|||
// id: id,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const getById = (id: string) => { |
|||
return defAbpHttp.get<OpenIddictTokenDto>({ |
|||
url: `/api/openiddict/tokens/${id}`, |
|||
}, { |
|||
withToken: false |
|||
}); |
|||
}; |
|||
|
|||
// export const getList = (input: OpenIddictTokenGetListInput) => {
|
|||
// return defAbpHttp.pagedRequest<OpenIddictTokenDto>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'GetListAsync',
|
|||
// params: {
|
|||
// input: input,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const getList = (input: OpenIddictTokenGetListInput) => { |
|||
return defAbpHttp.get<PagedResultDto<OpenIddictTokenDto>>({ |
|||
url: '/api/openiddict/tokens', |
|||
params: input, |
|||
}, { |
|||
withToken: false |
|||
}); |
|||
}; |
|||
|
|||
|
|||
// export const deleteById = (id: string) => {
|
|||
// return defAbpHttp.request<void>({
|
|||
// service: remoteServiceName,
|
|||
// controller: controllerName,
|
|||
// action: 'DeleteAsync',
|
|||
// params: {
|
|||
// id: id,
|
|||
// },
|
|||
// });
|
|||
// };
|
|||
|
|||
export const deleteById = (id: string) => { |
|||
return defAbpHttp.delete<void>({ |
|||
url: `/api/openiddict/tokens/${id}`, |
|||
}, { |
|||
withToken: false |
|||
}); |
|||
}; |
|||
@ -0,0 +1,29 @@ |
|||
import { ExtensibleAuditedEntity, PagedAndSortedResultRequestDto } from '../../../model/baseModel'; |
|||
|
|||
export interface OpenIddictTokenDto extends ExtensibleAuditedEntity<string> { |
|||
applicationId?: string; |
|||
authorizationId?: string; |
|||
creationDate?: Date; |
|||
expirationDate?: Date; |
|||
payload?: string; |
|||
properties?: string; |
|||
redemptionDate?: Date; |
|||
referenceId?: string; |
|||
type?: string; |
|||
status?: string; |
|||
subject?: string; |
|||
} |
|||
|
|||
export interface OpenIddictTokenGetListInput extends PagedAndSortedResultRequestDto { |
|||
filter?: string; |
|||
clientId?: string; |
|||
authorizationId?: string; |
|||
subject?: string; |
|||
status?: string; |
|||
type?: string; |
|||
referenceId?: string; |
|||
beginCreationTime?: Date; |
|||
endCreationTime?: string; |
|||
beginExpirationDate?: Date; |
|||
endExpirationDate?: Date; |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { |
|||
BackgroundJobAction, |
|||
BackgroundJobActionDefinition, |
|||
CreateBackgroundJobAction, |
|||
UpdateBackgroundJobAction, |
|||
BackgroundJobActionGetDefinitionsInput |
|||
} from './model/backgroundJobActionModel'; |
|||
import { format } from '/@/utils/strings'; |
|||
import { ListResultDto } from '../model/baseModel'; |
|||
|
|||
enum Api { |
|||
AddAction = '/api/task-management/background-jobs/actions/{jobId}', |
|||
UpdateAction = '/api/task-management/background-jobs/actions/{id}', |
|||
DeleteAction = '/api/task-management/background-jobs/actions/{id}', |
|||
GetActions = '/api/task-management/background-jobs/actions/{jobId}', |
|||
GetDefinitions = '/api/task-management/background-jobs/actions/definitions', |
|||
} |
|||
|
|||
export const addAction = (jobId: string, input: CreateBackgroundJobAction) => { |
|||
return defAbpHttp.post<BackgroundJobAction>({ |
|||
url: format(Api.AddAction, { jobId: jobId }), |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const updateAction = (id: string, input: UpdateBackgroundJobAction) => { |
|||
return defAbpHttp.put<BackgroundJobAction>({ |
|||
url: format(Api.UpdateAction, { id: id }), |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const deleteAction = (id: string) => { |
|||
return defAbpHttp.delete<void>({ |
|||
url: format(Api.DeleteAction, { id: id }), |
|||
}); |
|||
}; |
|||
|
|||
export const getActions = (jobId: string) => { |
|||
return defAbpHttp.get<ListResultDto<BackgroundJobAction>>({ |
|||
url: format(Api.GetActions, { jobId: jobId }), |
|||
}); |
|||
}; |
|||
|
|||
export const getDefinitions = (input: BackgroundJobActionGetDefinitionsInput) => { |
|||
return defAbpHttp.get<ListResultDto<BackgroundJobActionDefinition>>({ |
|||
url: Api.GetDefinitions, |
|||
params: input, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,43 @@ |
|||
export enum JobActionType { |
|||
Failed = -1, |
|||
Successed = 0, |
|||
} |
|||
|
|||
export interface BackgroundJobAction { |
|||
id: string; |
|||
jobId: string; |
|||
name: string; |
|||
displayName?: string; |
|||
isEnabled: boolean; |
|||
paramters: ExtraPropertyDictionary; |
|||
} |
|||
|
|||
export interface BackgroundJobActionParamter { |
|||
name: string; |
|||
required: boolean; |
|||
displayName: string; |
|||
description?: string; |
|||
} |
|||
|
|||
export interface BackgroundJobActionDefinition { |
|||
name: string; |
|||
type: JobActionType; |
|||
displayName: string; |
|||
description?: string; |
|||
paramters: BackgroundJobActionParamter[]; |
|||
} |
|||
|
|||
export interface CreateBackgroundJobAction { |
|||
name: string; |
|||
isEnabled: boolean; |
|||
paramters: ExtraPropertyDictionary; |
|||
} |
|||
|
|||
export interface UpdateBackgroundJobAction { |
|||
isEnabled: boolean; |
|||
paramters: ExtraPropertyDictionary; |
|||
} |
|||
|
|||
export interface BackgroundJobActionGetDefinitionsInput { |
|||
type?: JobActionType; |
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
import { defAbpHttp } from '/@/utils/http/abp'; |
|||
import { PagedResultDto } from '../../model/baseModel'; |
|||
import { |
|||
TextTemplateDefinition, |
|||
TextTemplateContent, |
|||
TextTemplateContentGetInput, |
|||
TextTemplateUpdateInput, |
|||
TextTemplateRestoreInput, |
|||
TextTemplateDefinitionGetListInput, |
|||
} from './model'; |
|||
|
|||
const remoteServiceName = 'AbpTextTemplating'; |
|||
const controllerName = 'TextTemplate'; |
|||
|
|||
export const get = (name: string) => { |
|||
return defAbpHttp.request<TextTemplateDefinition>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetAsync', |
|||
params: { |
|||
name: name, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const getContent = (input: TextTemplateContentGetInput) => { |
|||
return defAbpHttp.request<TextTemplateContent>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetContentAsync', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
export const getList = (input: TextTemplateDefinitionGetListInput) => { |
|||
return defAbpHttp.request<PagedResultDto<TextTemplateDefinition>>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'GetListAsync', |
|||
params: { |
|||
input: input, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
export const restoreToDefault = (input: TextTemplateRestoreInput) => { |
|||
return defAbpHttp.request<void>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'RestoreToDefaultAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
|
|||
export const update = (input: TextTemplateUpdateInput) => { |
|||
return defAbpHttp.request<TextTemplateDefinition>({ |
|||
service: remoteServiceName, |
|||
controller: controllerName, |
|||
action: 'UpdateAsync', |
|||
data: input, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,36 @@ |
|||
import { PagedAndSortedResultRequestDto } from "/@/api/model/baseModel"; |
|||
|
|||
export interface TextTemplateDefinition { |
|||
name: string; |
|||
displayName: string; |
|||
defaultCultureName?: string; |
|||
isInlineLocalized: boolean; |
|||
isLayout: boolean; |
|||
layout?: string; |
|||
} |
|||
|
|||
export interface TextTemplateContent { |
|||
name: string; |
|||
content?: string; |
|||
culture?: string; |
|||
} |
|||
|
|||
export interface TextTemplateContentGetInput { |
|||
name: string; |
|||
culture?: string; |
|||
} |
|||
|
|||
export interface TextTemplateRestoreInput { |
|||
name: string; |
|||
culture?: string; |
|||
} |
|||
|
|||
export interface TextTemplateUpdateInput { |
|||
name: string; |
|||
culture?: string; |
|||
content: string; |
|||
} |
|||
|
|||
export interface TextTemplateDefinitionGetListInput extends PagedAndSortedResultRequestDto { |
|||
filter?: string; |
|||
} |
|||
@ -1,8 +1,10 @@ |
|||
import { withInstall } from '/@/utils'; |
|||
import codeEditor from './src/CodeEditor.vue'; |
|||
import codeEditorX from './src/codemirrorX/CodeMirrorX.vue'; |
|||
import jsonPreview from './src/json-preview/JsonPreview.vue'; |
|||
|
|||
export const CodeEditor = withInstall(codeEditor); |
|||
export const CodeEditorX = withInstall(codeEditorX); |
|||
export const JsonPreview = withInstall(jsonPreview); |
|||
|
|||
export * from './src/typing'; |
|||
|
|||
@ -0,0 +1,137 @@ |
|||
<template> |
|||
<textarea style="overflow: auto;" ref="codeEditor"></textarea> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { computed, ref, unref, watch, nextTick, onMounted } from 'vue'; |
|||
import CodeMirror from 'codemirror'; |
|||
import '../codemirror/codemirror.css'; |
|||
import 'codemirror/theme/idea.css'; |
|||
import 'codemirror/theme/dracula.css'; |
|||
|
|||
import 'codemirror/mode/javascript/javascript'; |
|||
import 'codemirror/mode/htmlmixed/htmlmixed'; |
|||
import 'codemirror/mode/css/css'; |
|||
|
|||
import 'codemirror/addon/fold/foldcode'; |
|||
import 'codemirror/addon/fold/foldgutter'; |
|||
import 'codemirror/addon/fold/foldgutter.css'; |
|||
import 'codemirror/addon/fold/brace-fold'; |
|||
import 'codemirror/addon/fold/xml-fold'; |
|||
import 'codemirror/addon/fold/comment-fold'; |
|||
import 'codemirror/addon/fold/markdown-fold'; |
|||
import 'codemirror/addon/fold/indent-fold'; |
|||
import 'codemirror/addon/edit/closebrackets'; |
|||
import 'codemirror/addon/edit/closetag'; |
|||
import 'codemirror/addon/edit/matchtags'; |
|||
import 'codemirror/addon/edit/matchbrackets'; |
|||
import 'codemirror/addon/selection/active-line'; |
|||
import "codemirror/addon/scroll/annotatescrollbar"; |
|||
import 'codemirror/addon/dialog/dialog'; |
|||
import 'codemirror/addon/dialog/dialog.css'; |
|||
import 'codemirror/addon/display/autorefresh'; |
|||
import 'codemirror/addon/display/placeholder'; |
|||
import 'codemirror/addon/selection/mark-selection'; |
|||
|
|||
import { MODE } from './../typing'; |
|||
import { isString } from '/@/utils/is'; |
|||
import { useAppStore } from '/@/store/modules/app'; |
|||
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'; |
|||
|
|||
const codeEditor = ref(); |
|||
const appStore = useAppStore(); |
|||
let editor: Nullable<CodeMirror.Editor>; |
|||
|
|||
const props = defineProps({ |
|||
mode: { |
|||
type: String as PropType<MODE>, |
|||
default: MODE.JSON, |
|||
validator(value: any) { |
|||
// 这个值必须匹配下列字符串中的一个 |
|||
return Object.values(MODE).includes(value); |
|||
}, |
|||
}, |
|||
modelValue: { |
|||
type: [Object, String] as PropType<Record<string, any> | string>, |
|||
default: '', |
|||
}, |
|||
readonly: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
}); |
|||
const emits = defineEmits(['update:modelValue', 'format-error']); |
|||
|
|||
const getValue = computed(() => { |
|||
const { mode, modelValue } = props; |
|||
if (mode !== MODE.JSON) { |
|||
return modelValue as string; |
|||
} |
|||
let result = modelValue; |
|||
if (isString(result)) { |
|||
try { |
|||
result = JSON.parse(result); |
|||
} catch (e) { |
|||
emits('format-error', modelValue); |
|||
return modelValue as string; |
|||
} |
|||
} |
|||
return JSON.stringify(result, null, 2); |
|||
}); |
|||
|
|||
watch( |
|||
() => getValue.value, |
|||
async (value) => { |
|||
await nextTick(); |
|||
const oldValue = editor?.getValue(); |
|||
if (value !== oldValue) { |
|||
setTimeout(() => { |
|||
editor?.setValue(value); |
|||
}, 100); |
|||
} |
|||
}, |
|||
{ flush: 'post' }, |
|||
); |
|||
|
|||
watch( |
|||
() => appStore.getDarkMode, |
|||
async () => { |
|||
setTheme(); |
|||
}, |
|||
{ |
|||
immediate: true, |
|||
}, |
|||
); |
|||
|
|||
function setTheme() { |
|||
unref(editor)?.setOption( |
|||
'theme', |
|||
appStore.getDarkMode === 'light' ? 'idea' : 'dracula', |
|||
); |
|||
} |
|||
|
|||
onMounted(() => { |
|||
editor = CodeMirror.fromTextArea(codeEditor.value, { |
|||
value: '', |
|||
autoRefresh: true, |
|||
mode: props.mode, |
|||
indentWithTabs: false, // 在缩进时,是否需要把 n*tab宽度个空格替换成n个tab字符,默认为false |
|||
smartIndent: true, // 自动缩进,设置是否根据上下文自动缩进(和上一行相同的缩进量)。默认为true |
|||
lineNumbers: true, // 是否在编辑器左侧显示行号 |
|||
matchBrackets: true, // 括号匹配 |
|||
readOnly: props.readonly, |
|||
// 启用代码折叠相关功能:开始 |
|||
foldGutter: true, |
|||
lineWrapping: true, |
|||
// 启用代码折叠相关功能:结束 |
|||
styleActiveLine: true, // 光标行高亮 |
|||
}); |
|||
// 监听编辑器的change事件 |
|||
editor.on("change", () => { |
|||
// 触发v-model的双向绑定 |
|||
emits('update:modelValue', editor!.getValue()); |
|||
}); |
|||
useWindowSizeFn(editor.refresh); |
|||
}); |
|||
|
|||
</script> |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue