Browse Source

提供restful示例 参考 customer 客户管理(资源示例)版块 涉及到权限变动 请更新数据库 sys_api和casbin表

main
pixel 5 years ago
parent
commit
8341eda1fa
  1. 1
      README-zh_CN.md
  2. 2
      README.md
  3. 4
      server/service/sys_api.go
  4. 3
      web/src/view/superAdmin/api/api.vue

1
README-zh_CN.md

@ -180,6 +180,7 @@ go run main.go;
- 配置管理:配置文件可前台修改(测试环境不开放此功能)。 - 配置管理:配置文件可前台修改(测试环境不开放此功能)。
- 富文本编辑器:MarkDown编辑器功能嵌入。 - 富文本编辑器:MarkDown编辑器功能嵌入。
- 条件搜索:增加条件搜索示例。 - 条件搜索:增加条件搜索示例。
- restful示例:参考客户管理功能,customer组api。
``` ```
前端文件参考: src\view\superAdmin\api\api.vue 前端文件参考: src\view\superAdmin\api\api.vue
后台文件参考: model\dnModel\api.go 后台文件参考: model\dnModel\api.go

2
README.md

@ -177,6 +177,8 @@ go run main.go;
- Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function). - Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function).
- Rich text editor: Embed MarkDown editor function. - Rich text editor: Embed MarkDown editor function.
- Conditional search: Add an example of conditional search. - Conditional search: Add an example of conditional search.
- Restful example: refer to customer management function and apidcustomer group.
``` ```
fontend code file: src\view\superAdmin\api\api.vue fontend code file: src\view\superAdmin\api\api.vue
backend code file: model\dnModel\api.go backend code file: model\dnModel\api.go

4
server/service/sys_api.go

@ -61,6 +61,10 @@ func GetAPIInfoList(api model.SysApi, info request.PageInfo, order string, desc
db = db.Where("method = ?", api.Method) db = db.Where("method = ?", api.Method)
} }
if api.ApiGroup != "" {
db = db.Where("api_group = ?", api.ApiGroup)
}
err = db.Find(&apiList).Count(&total).Error err = db.Find(&apiList).Count(&total).Error
if err != nil { if err != nil {

3
web/src/view/superAdmin/api/api.vue

@ -8,6 +8,9 @@
<el-form-item label="描述"> <el-form-item label="描述">
<el-input placeholder="描述" v-model="searchInfo.description"></el-input> <el-input placeholder="描述" v-model="searchInfo.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="api组">
<el-input placeholder="api组" v-model="searchInfo.apiGroup"></el-input>
</el-form-item>
<el-form-item label="请求"> <el-form-item label="请求">
<el-select clearable placeholder="请选择" v-model="searchInfo.method"> <el-select clearable placeholder="请选择" v-model="searchInfo.method">
<el-option <el-option

Loading…
Cancel
Save