21 Commits
3.1.8 ... 3.1.9

Author SHA1 Message Date
JaguarJack
4606f9c792 fix:角色选择数据权限报错 2024-02-21 16:33:22 +08:00
JaguarJack
604c17584f update version 2024-02-21 16:16:03 +08:00
JaguarJack
8e63216e63 添加微信 2024-02-21 12:17:51 +08:00
JaguarJack
4bf1658c2e feat:账户禁用功能 2024-02-01 10:09:47 +08:00
JaguarJack
8e0ec2a6a9 fix:修复 ElementPlus 语言错误 2024-01-24 11:51:49 +08:00
JaguarJack
90ad443178 修改elementplus 语言 2024-01-24 11:49:22 +08:00
JaguarJack
324c974505 update package 2024-01-23 09:08:47 +08:00
JaguarJack
d93275fa2d update package 2024-01-23 09:01:37 +08:00
JaguarJack
832c65275e add default pipeline template yaml 2024-01-09 01:52:36 +00:00
JaguarJack
4b15b2f01c update 2023-12-12 15:01:45 +08:00
JaguarJack
4814521198 update scripts 2023-12-12 14:19:10 +08:00
JaguarJack
6058d1e7e0 update 2023-12-12 13:44:53 +08:00
JaguarJack
5fc2ad54c6 chore 2023-12-12 11:07:55 +08:00
JaguarJack
601574f812 fix:默认使用中文语言 2023-11-30 11:12:33 +08:00
JaguarJack
e711546d02 chore 2023-11-22 11:07:11 +08:00
JaguarJack
96aef3ce94 fix:菜单组件更新错误 2023-11-21 17:35:50 +08:00
JaguarJack
558ad1271b fix:模块路由初始化错误 2023-11-06 18:30:38 +08:00
JaguarJack
1d40dd9fe2 fix:生成action时loading效果 2023-08-31 08:59:48 +08:00
JaguarJack
07621425dc chore:新增腾讯镜像 2023-08-14 11:33:04 +08:00
JaguarJack
4008ebdf7e chore:更新核心版本至0.2.2 2023-08-11 11:47:11 +08:00
JaguarJack
fd82aa75e1 chore 2023-08-09 15:42:42 +08:00
15 changed files with 241 additions and 54 deletions

View File

@@ -0,0 +1,51 @@
version: '1.0'
name: branch-pipeline
displayName: BranchPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@php
name: build_php
displayName: PHP 构建
# 支持5.0、7.0、7.1、7.2、7.3、7.4、8.0、8.1八个版本
phpVersion: 8.0
# 构建命令
commands:
- php --version
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_php
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增,默认开启
autoIncrement: true
triggers:
push:
branches:
exclude:
- master
include:
- .*

View File

@@ -0,0 +1,49 @@
version: '1.0'
name: master-pipeline
displayName: MasterPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@php
name: build_php
displayName: PHP 构建
# 支持5.0、7.0、7.1、7.2、7.3、7.4、8.0、8.1八个版本
phpVersion: 8.0
# 构建命令
commands:
- php --version
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_php
- stage:
name: release
displayName: 发布
steps:
- step: publish@release_artifacts
name: publish_release_artifacts
displayName: '发布'
# 上游上传制品任务的产出
dependArtifact: output
# 发布制品版本号
version: '1.0.0.0'
# 是否开启版本号自增,默认开启
autoIncrement: true
triggers:
push:
branches:
include:
- master

36
.workflow/pr-pipeline.yml Normal file
View File

@@ -0,0 +1,36 @@
version: '1.0'
name: pr-pipeline
displayName: PRPipeline
stages:
- stage:
name: compile
displayName: 编译
steps:
- step: build@php
name: build_php
displayName: PHP 构建
# 支持5.0、7.0、7.1、7.2、7.3、7.4、8.0、8.1八个版本
phpVersion: 8.0
# 构建命令
commands:
- php --version
# 非必填字段开启后表示将构建产物暂存但不会上传到制品库中7天后自动清除
artifacts:
# 构建产物名字作为产物的唯一标识可向下传递支持自定义默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
- name: BUILD_ARTIFACT
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
path:
- ./
- step: publish@general_artifacts
name: publish_general_artifacts
displayName: 上传制品
# 上游构建任务定义的产物名默认BUILD_ARTIFACT
dependArtifact: BUILD_ARTIFACT
# 上传到制品库时的制品命名默认output
artifactName: output
dependsOn: build_php
triggers:
pr:
branches:
include:
- master

View File

@@ -3,6 +3,16 @@
[中文](./README.md)|[英文](./README-en.md)
## 专业版
[专业版本官方地址](https://license.catchadmin.com)
首先感谢一直以来对 `CatchAdmin` 开源项目的支持和使用。作为一名开源工作者,我一直致力于开发出功能强大且易于使用的后台管理系统,以帮助您简化业务流程和提升工作效率。然而,由于某些原因,我不得不做出一些调整。为了能够继续开发和维护这个项目,我将推出一款付费的后台管理系统,以确保我能够持续为您提供高质量的服务和支持。
专业版本不会在开源版本做一些破坏性变更,所以当您从开源版本切换到专业版本,不会有任何开发心智负担。但是使用专业版本会有新的组件来配合您的工作。
我深信,付费后台管理系统将为您带来更多的价值和便利,帮助您提升工作效率
## ⚠Thinkphp 用户注意
由于新版本使用 `Laravel` 开发,所以请使用 `thinkphp` 分支或者 tag2.6.2thinkphp 版本已经非常稳定了。
@@ -21,6 +31,14 @@
- [x] Schema 管理 生成表结构
- [x] 模块管理 系统模块管理
## 讨论
- 可以提 `ISSUE`,请按照 `issue` 模板提问
- 加入 Q 群 `302266230` 暗号 `catchadmin`
- 加微信入群,新建🆕
<img src="wechat.png" width="300"/>
## 额外模块
- [CMS 模块](https://github.com/catch-admin/cms)
@@ -45,11 +63,6 @@
- [catchadmin 开发之模块创建](https://www.bilibili.com/video/BV1jP41127aW/)
- [catchadmin 之快速开发](https://www.bilibili.com/video/BV1Qh4y1J7eB/)
## 赞助
如果项目对你有帮助,或者在工作上帮你节省了开发时间。在力所能及的情况下,可以支持下`Catchadmin`项目, 非常感谢🙏
<img src="https://i.imgtg.com/2023/02/16/dAV0a.jpg" width = "200" alt="support"/>
## 规范
### PHP
使用 fixer 进行代码检查, 具体请查看根目录下 `.php-cs-fixer.dist.php` 文件的规范,还需要进行以下两步骤
@@ -68,12 +81,6 @@ composer cs
composer cs-diff
```
## 讨论
- [论坛讨论](https://bbs.catchadmin.com)
- 可以提 `ISSUE`,请按照 `issue` 模板提问
- 加入 Q 群 `302266230` 暗号 `catchadmin`
## 感谢🙏
> 排名不分先后

View File

@@ -18,7 +18,7 @@
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.0",
"laravel/tinker": "^2.8",
"catchadmin/core": "^0.2.1"
"catchadmin/core": "^0.2.7"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
@@ -42,7 +42,8 @@
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
"@php artisan package:discover --ansi",
"@composer dump-autoload --no-scripts"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"

View File

@@ -185,7 +185,6 @@ return [
/*
* Package Service Providers...
*/
\Catch\Providers\CatchAdminServiceProvider::class,
/*
* Application Service Providers...

View File

@@ -81,6 +81,13 @@ class Module
*/
protected function createRoute(): void
{
File::copy(__DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'route.stub', CatchAdmin::getModuleRoutePath($this->module));
$content = Str::of(
File::get(__DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'route.stub')
)->replace(['{module}'], [lcfirst($this->module)]);
File::put(
CatchAdmin::getModuleRoutePath($this->module),
$content
);
}
}

View File

@@ -6,6 +6,7 @@ namespace Modules\Permissions\Http\Controllers;
use Catch\Base\CatchController as Controller;
use Catch\Exceptions\FailedException;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Modules\Permissions\Enums\DataRange;
use Modules\Permissions\Models\Roles;
@@ -41,10 +42,14 @@ class RolesController extends Controller
public function store(RoleRequest $request)
{
$data = $request->all();
$data['data_range'] = (int) $data['data_range'];
if (!$data['data_range'] || !DataRange::Personal_Choose->assert($data['data_range'])) {
if (!isset($data['data_range'])) {
$data['data_range'] = 0;
} else {
$data['data_range'] = (int)$data['data_range'];
if (!DataRange::Personal_Choose->assert($data['data_range'])) {
$data['departments'] = [];
}
}
return $this->model->storeBy($data);
}
@@ -52,7 +57,8 @@ class RolesController extends Controller
/**
*
* @param $id
* @return \Illuminate\Database\Eloquent\Model|null
* @param Request $request
* @return Model|null
*/
public function show($id, Request $request)
{
@@ -79,7 +85,7 @@ class RolesController extends Controller
{
$data = $request->all();
$data['data_range'] = (int) $data['data_range'];
if (!$data['data_range'] || !DataRange::Personal_Choose->assert($data['data_range'])) {
if (!DataRange::Personal_Choose->assert($data['data_range'])) {
$data['departments'] = [];
}

View File

@@ -200,7 +200,9 @@ class Permissions extends Model
$data['route'] = '/'.trim($data['route'], '/');
}
if (isset($data['component'])) {
$data['component'] = Str::of($data['component'])->replace('\\', '/')->toString();
}
return parent::storeBy($data);
});
}
@@ -246,7 +248,9 @@ class Permissions extends Model
$data['permission_mark'] = $parentMenu->permission_mark.'@'.$data['permission_mark'];
}
if (isset($data['component'])) {
$data['component'] = Str::of($data['component'])->replace('\\', '/')->toString();
}
return parent::updateBy($id, $data);
}
}

View File

@@ -21,7 +21,7 @@
<el-popconfirm confirm-button-text="确认" title="添加基础actions" @confirm="actionGenerate(scope.row.id)" placement="top">
<template #reference>
<el-tag class="cursor-pointer w-8" v-if="scope.row.type === MenuType.PAGE_TYPE">
<Icon name="cog-6-tooth" class="animate-spin w-5 h-5" v-if="actionLoading" />
<Icon name="cog-6-tooth" class="animate-spin w-5 h-5" v-if="generateId === scope.row.id" />
<Icon name="plus" className="w-4 h-4" v-else />
</el-tag>
</template>
@@ -73,11 +73,18 @@ onMounted(() => {
})
const actionLoading = ref<boolean>(false)
const generateId = ref<number>(0)
const actionGenerate = async (id: number) => {
actionLoading.value = true
http.post(api, { parent_id: id, actions: true }).then(r => {
generateId.value = id
http
.post(api, { parent_id: id, actions: true })
.then(r => {
search()
actionLoading.value = false
generateId.value = 0
})
.catch(e => {
generateId.value = 0
catchtable.value.reset()
})
}
</script>

View File

@@ -22,12 +22,18 @@ class AuthController extends Controller
/* @var User $user */
$user = User::query()->where('email', $request->get('email'))->first();
Event::dispatch(new Login($request, $user));
Event::dispatch(new Login($request, $user ? ($user->isDisabled() ? null : $user) : null));
if ($user && Hash::check($request->get('password'), $user->password)) {
if ($user) {
if ($user->isDisabled()) {
throw new FailedException('账号被禁用,请联系管理员');
}
if (Hash::check($request->get('password'), $user->password)) {
$token = $user->createToken('token')->plainTextToken;
return compact('token');
}
}
throw new FailedException('登录失败!请检查邮箱或者密码');
}

View File

@@ -3,6 +3,7 @@
namespace Modules\User\Models;
use Catch\Base\CatchModel as Model;
use Catch\Enums\Status;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Laravel\Sanctum\HasApiTokens;
@@ -102,4 +103,10 @@ class User extends Model implements AuthenticatableContract
return parent::updateBy($id, $data);
}
public function isDisabled(): bool
{
return $this->status == Status::Disable->value;
}
}

View File

@@ -8,16 +8,16 @@
"preview": "vite preview"
},
"dependencies": {
"@heroicons/vue": "^2.0.18",
"@tinymce/tinymce-vue": "^5.1.0",
"@heroicons/vue": "^2.1.1",
"@tinymce/tinymce-vue": "^5.1.1",
"@vueuse/core": "^10.1.2",
"element-plus": "^2.3.5",
"element-plus": "^2.5.3",
"nprogress": "^0.2.0",
"pinia": "^2.1.3",
"pinia": "^2.1.7",
"terser": "^5.16.6",
"vue": "^3.3.4",
"vue": "^3.4.15",
"vue-i18n": "9",
"vue-router": "4.2.1",
"vue-router": "4.2.5",
"vuedraggable": "^2.24.3"
},
"devDependencies": {
@@ -26,28 +26,28 @@
"@types/mockjs": "^1.0.7",
"@types/node": "^20.2.3",
"@types/nprogress": "^0.2.0",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"autoprefixer": "^10.4.14",
"axios": "^1.4.0",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@vitejs/plugin-vue": "^5.0.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"autoprefixer": "^10.4.17",
"axios": "^1.5.1",
"eslint": "^8.41.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.14.0",
"eslint-plugin-vue": "^9.19.2",
"mockjs": "^1.1.0",
"postcss": "^8.4.23",
"postcss": "^8.4.33",
"prettier": "2.8.8",
"sass": "^1.62.1",
"tailwindcss": "^3.3.2",
"typescript": "^5.0.4",
"unplugin-auto-import": "^0.16.2",
"unplugin-icons": "^0.16.1",
"unplugin-vue-components": "^0.24.0",
"vite": "^4.3.8",
"tailwindcss": "^3.4.1",
"typescript": "^5.1.6",
"unplugin-auto-import": "^0.17.3",
"unplugin-icons": "^0.18.2",
"unplugin-vue-components": "^0.25.2",
"vite": "^5.0.12",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^3.0.0",
"vue-tsc": "^1.6.5"

View File

@@ -4,11 +4,14 @@ import App from '/admin/App.vue'
import router, { bootstrapRouter } from '/admin/router'
import ElementPlus from 'element-plus'
import zh from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'
import { bootstrapStore } from '/admin/stores'
import Cache from './cache'
import { bootstrapI18n } from '/admin/i18n'
import guard from '/admin/router/guard'
import { bootstrapDirectives } from '/admin/directives'
import { Language } from 'element-plus/es/locale'
/**
* catchadmin
@@ -63,9 +66,13 @@ export default class CatchAdmin {
* @returns
*/
protected useElementPlus(): CatchAdmin {
// @ts-ignore
const languages: Record<string, Language> = {
zh, en
}
const language = Cache.get('language') || 'zh'
this.app.use(ElementPlus, {
locale: Cache.get('language') === 'zh' && zh,
locale: languages[language]
})
return this
}

BIN
wechat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB