Skip to content

Commit 34a3acb

Browse files
committed
补充oss配置
1 parent edeac3c commit 34a3acb

File tree

3 files changed

+121
-16
lines changed

3 files changed

+121
-16
lines changed

docs/guide/server/config.md

+24-14
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,34 @@ type Casbin struct {
194194
```yaml
195195
# system configuration
196196
system:
197-
env: 'public' # Change to "develop" to skip authentication for development mode
198-
addr: 8888
199-
db-type: 'mysql'
200-
oss-type: 'local'
201-
use-multipoint: false
202-
use-redis: false
203-
iplimit-count: 15000
204-
iplimit-time: 3600
197+
db-type: mysql
198+
oss-type: local
199+
router-prefix: ""
200+
addr: 8888
201+
iplimit-count: 15000
202+
iplimit-time: 3600
203+
use-multipoint: false
204+
use-redis: false
205+
use-mongo: false
206+
use-strict-auth: false
205207
```
206208

207209
### struct
208210

209211
```go
210212
type System struct {
211-
Env string `mapstructure:"env" json:"env" yaml:"env"`
212-
Addr int `mapstructure:"addr" json:"addr" yaml:"addr"`
213-
DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
214-
OssType string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"`
215-
UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
213+
DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql
214+
OssType string `mapstructure:"oss-type" json:"oss-type" yaml:"oss-type"` // Oss类型
215+
RouterPrefix string `mapstructure:"router-prefix" json:"router-prefix" yaml:"router-prefix"`
216+
Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 端口值
217+
LimitCountIP int `mapstructure:"iplimit-count" json:"iplimit-count" yaml:"iplimit-count"`
218+
LimitTimeIP int `mapstructure:"iplimit-time" json:"iplimit-time" yaml:"iplimit-time"`
219+
UseMultipoint bool `mapstructure:"use-multipoint" json:"use-multipoint" yaml:"use-multipoint"` // 多点登录拦截
220+
UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis
221+
UseMongo bool `mapstructure:"use-mongo" json:"use-mongo" yaml:"use-mongo"` // 使用mongo
222+
UseStrictAuth bool `mapstructure:"use-strict-auth" json:"use-strict-auth" yaml:"use-strict-auth"` // 使用树形角色分配模式
216223
}
224+
217225
```
218226

219227
### description
@@ -222,12 +230,14 @@ type System struct {
222230
| -------------- | ------ |--------------------------------------------------------------------------------------------------------------------------------------|
223231
| env | string | 更改为“develop”以跳过开发模式的身份验证 |
224232
| addr | int | 后端端口,默认8888 |
225-
| db-type | string | 可以使用 pgsql,sqlite,mssql,oracle |
233+
| db-type | string | 可以使用 pgsql,sqlite,mssql,oracle |
226234
| oss-type | string | 可以指定上传头像的oss为local/qiniu/aliyun/minio<br />local:本地的 `local.path` 目录<br />qiniu:七牛云<br />aliyun与minio可能框架不会集成,需自己添加,或者参考 [额外功能](oss) |
227235
| use-multipoint | bool | 单点登录,默认为关闭 |
228236
| use-redis | bool | 使用redis,默认为关闭 |
229237
| iplimit-count | int | time时间段内同IP最多访问次数,默认为15000 |
230238
| iplimit-time | int | 限制时间区间,默认为3600 |
239+
| use-mongo | bool | 是否使用mongodb |
240+
| use-strict-auth | bool | 是否开启[严格角色模式](strictAuth) |
231241

232242
## captcha
233243

docs/guide/server/oss.md

+71-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1-
# oss 对象存储
1+
# 对象存储
2+
当前支持本地、阿里云、腾讯云、七牛云、AWS S3、华为云、Cloudflare R2 七种对象存储方式,可根据实际情况进行配置。
23

3-
> 需要重写!
4+
```yaml
5+
local:
6+
path: uploads/file
7+
store-path: uploads/file
8+
```
9+
10+
```yaml
11+
aliyun-oss:
12+
endpoint: yourEndpoint
13+
access-key-id: yourAccessKeyId
14+
access-key-secret: yourAccessKeySecret
15+
bucket-name: yourBucketName
16+
bucket-url: yourBucketUrl
17+
base-path: yourBasePath
18+
```
19+
20+
```yaml
21+
aws-s3:
22+
bucket: xxxxx-10005608
23+
region: ap-shanghai
24+
endpoint: ""
25+
secret-id: your-secret-id
26+
secret-key: your-secret-key
27+
base-url: https://gin.vue.admin
28+
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
29+
s3-force-path-style: false
30+
disable-ssl: false
31+
```
32+
33+
```yaml
34+
qiniu:
35+
zone: ZoneHuaDong
36+
bucket: ""
37+
img-path: ""
38+
access-key: ""
39+
secret-key: ""
40+
use-https: false
41+
use-cdn-domains: false
42+
```
43+
44+
```yaml
45+
tencent-cos:
46+
bucket: xxxxx-10005608
47+
region: ap-shanghai
48+
secret-id: your-secret-id
49+
secret-key: your-secret-key
50+
base-url: https://gin.vue.admin
51+
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
52+
```
53+
54+
```yaml
55+
hua-wei-obs:
56+
path: you-path
57+
bucket: you-bucket
58+
endpoint: you-endpoint
59+
access-key: you-access-key
60+
secret-key: you-secret-key
61+
```
62+
63+
64+
```yaml
65+
cloudflare-r2:
66+
bucket: xxxx0bucket
67+
base-url: https://gin.vue.admin.com
68+
path: uploads
69+
account-id: xxx_account_id
70+
access-key-id: xxx_key_id
71+
secret-access-key: xxx_secret_key
72+
```

docs/guide/server/strictAuth.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# strictAuth 严格角色模式
2+
3+
## 介绍
4+
5+
开启严格角色模式后,用户只能访问其拥有的角色权限,无法访问其他角色的权限。
6+
7+
## 配置
8+
9+
```yaml
10+
system:
11+
db-type: mysql
12+
oss-type: local
13+
router-prefix: ""
14+
addr: 8888
15+
iplimit-count: 15000
16+
iplimit-time: 3600
17+
use-multipoint: false
18+
use-redis: false
19+
use-mongo: false
20+
use-strict-auth: true # 这里修改为true
21+
```
22+
23+
## 使用
24+
如果为顶级角色 则可以看到自己的角色且可以分配自己角色的相关api权限和菜单权限
25+
如果为子角色 则无法看到自己角色,能看到自己角色的下级所有角色,且可以对下级以及下级的所有角色做权限分配,分配范围为自己所有用的角色的所有权限
26+
```

0 commit comments

Comments
 (0)