Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Oct 18, 2024
1 parent a4c9852 commit fe6a55f
Show file tree
Hide file tree
Showing 7 changed files with 746 additions and 562 deletions.
1 change: 0 additions & 1 deletion .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ _hmt.push(['_requirePlugin', 'UrlChangeTracker', {
text: '扩展组件',
items: [
{ text: 'Auth 鉴权', link: '/components/auth' },
{ text: 'AuthAll 鉴权', link: '/components/auth-all' },
{ text: 'PageHeader 页头', link: '/components/page-header' },
{ text: 'PageMain 内容块', link: '/components/page-main' },
{ text: 'ActionContainer 固定底部操作栏', link: '/components/action-container' },
Expand Down
13 changes: 0 additions & 13 deletions components/auth-all.md

This file was deleted.

28 changes: 15 additions & 13 deletions components/auth.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Auth 鉴权

## Props

| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| :---- | :------------------------------------------------------------------------ | :------------- | :----- | :----- |
| value | 权限数据,如果传入为 array 时,匹配到其中一项则鉴权通过,并显示 slot 内容 | array / string | - | - |

## Slots

| name | 说明 |
| :--- | :------------------- |
| - | 需要鉴权的 HTML 内容 |
# Auth 鉴权

## Props

| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| :---- | :------------------------------------------------------- | :------------- | :----- | :----- |
| value | 权限数据,可传入单个或一组需要验证的权限数据 | array / string | - | - |
| all | 是否验证全部权限数据,默认匹配中其中一项则判定为鉴权成功 | boolean | - | false |

## Slots

| name | 说明 |
| :------ | :------------------- |
| - | 鉴权成功显示的 HTML 内容 |
| no-auth | 鉴权失败显示的 HTML 内容 |
39 changes: 39 additions & 0 deletions guide/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

只记录 feat/fix 以及破坏性更新记录。

## 4.8.0

:::info [基础版](https://github.com/one-step-admin/basic/releases/tag/v4.8.0)
🚨 Breaking Changes

- 重构鉴权指令、鉴权组件 &nbsp;-&nbsp; by @hooray [<samp>(cf955)</samp>](https://github.com/one-step-admin/basic/commit/cf955b2)

🐞 Bug Fixes

- 修复顶部相关布局时,顶栏重复渲染 &nbsp;-&nbsp; by @hooray [<samp>(868bf)</samp>](https://github.com/one-step-admin/basic/commit/868bf06)
- 修复vscode无法校验css文件 &nbsp;-&nbsp; by @hooray [<samp>(9bf13)</samp>](https://github.com/one-step-admin/basic/commit/9bf1369)

🏎 Performance

- 优化导航菜单折叠 &nbsp;-&nbsp; by @hooray [<samp>(d3f99)</samp>](https://github.com/one-step-admin/basic/commit/d3f99b0)
:::

:::tip [专业版](https://github.com/one-step-admin/pro/releases/tag/v4.8.0)
🚨 Breaking Changes

- 使用 watermark-js-plus 重构水印功能 &nbsp;-&nbsp; by @hooray [<samp>(f94a9)</samp>](https://github.com/one-step-admin/pro/commit/f94a92f)
- 重构鉴权指令、鉴权组件 &nbsp;-&nbsp; by @hooray [<samp>(cb023)</samp>](https://github.com/one-step-admin/pro/commit/cb023c0)

🚀 Features

- Dayjs 国际化跟随框架设置 &nbsp;-&nbsp; by @hooray [<samp>(cc7e1)</samp>](https://github.com/one-step-admin/pro/commit/cc7e172)
- 工具栏增加控制台切换按钮 &nbsp;-&nbsp; by @hooray [<samp>(c8158)</samp>](https://github.com/one-step-admin/pro/commit/c81586f)

🐞 Bug Fixes

- 修复应用配置里工具栏关闭的功能依旧会在在偏好设置里显示的bug &nbsp;-&nbsp; by @hooray [<samp>(ccb93)</samp>](https://github.com/one-step-admin/pro/commit/ccb931b)
- 修复顶部相关布局时,顶栏重复渲染 &nbsp;-&nbsp; by @hooray [<samp>(3d043)</samp>](https://github.com/one-step-admin/pro/commit/3d0439a)
- 修复vscode无法校验css文件 &nbsp;-&nbsp; by @hooray [<samp>(73257)</samp>](https://github.com/one-step-admin/pro/commit/73257d8)

🏎 Performance

- 优化导航菜单折叠 &nbsp;-&nbsp; by @hooray [<samp>(98dde)</samp>](https://github.com/one-step-admin/pro/commit/98dde14)
:::

## 4.7.0

:::info [基础版](https://github.com/one-step-admin/basic/releases/tag/v4.7.0)
Expand Down
36 changes: 18 additions & 18 deletions guide/permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,24 @@ const globalSettings: Settings.all = {

在演示源码中,默认提供了两组权限,你可以在“权限验证”导航里切换帐号查看不同权限下的效果。如果使用的不是 `admin``test` 用户名登录,则在导航栏里看不到“权限验证”导航入口。

## 鉴权指令

对于单个元素,提供了 `v-auth` 指令。

```vue-html
<!-- 单权限验证 -->
<button v-auth="'department.create'">新增部门</button>
<!-- 多权限验证,用户只要具备其中任何一个权限,则验证通过 -->
<button v-auth="['department.create', 'department.edit']">新增部门</button>
<!-- 多权限验证,用户必须具备全部权限,才验证通过 -->
<button v-auth.all="['department.create', 'department.edit']">新增部门</button>
```

## 鉴权组件

页面中某个模块,当前用户具备该权限是如何显示,不具备该权限又是如何显示,针对这样的需求,框架提供了 `<Auth>` `<AuthAll>` 组件,具体使用如下:
页面中某个模块,当前用户具备该权限是如何显示,不具备该权限又是如何显示,针对这样的需求,框架提供了 `<Auth>` 组件。

```vue-html
<!-- 单权限验证 -->
Expand All @@ -36,27 +51,12 @@ const globalSettings: Settings.all = {
</Auth>
<!-- 多权限验证,用户必须具备全部权限,才验证通过 -->
<AuthAll :value="['department.create', 'department.edit']">
<Auth :value="['department.create', 'department.edit']" all>
<p>你有该权限</p>
<template #no-auth>
<p>你没有该权限</p>
</template>
</AuthAll>
```

## 鉴权指令

对于单个元素,也提供了 `v-auth``v-auth-all` 鉴权指令,使用上对比鉴权组件更方便,当然它能做的事情也更简单。

```vue-html
<!-- 单权限验证 -->
<button v-auth="'department.create'">新增部门</button>
<!-- 多权限验证,用户只要具备其中任何一个权限,则验证通过 -->
<button v-auth="['department.create', 'department.edit']">新增部门</button>
<!-- 多权限验证,用户必须具备全部权限,才验证通过 -->
<button v-auth-all="['department.create', 'department.edit']">新增部门</button>
</Auth>
```

## 鉴权函数
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"vitepress-plugin-comment-with-giscus": "^1.1.15"
},
"devDependencies": {
"@antfu/eslint-config": "3.6.0",
"vitepress": "1.3.4",
"vue": "^3.5.5"
"@antfu/eslint-config": "3.8.0",
"vitepress": "1.4.1",
"vue": "^3.5.12"
}
}
Loading

0 comments on commit fe6a55f

Please sign in to comment.