fix: 修改

This commit is contained in:
gaoxiaolin.gao 2018-04-04 15:51:42 +08:00
parent 7845b9d35a
commit 7e6b15c5e1
12 changed files with 155 additions and 6 deletions

90
a.markdown Normal file
View File

@ -0,0 +1,90 @@
<h1 class="curproject-name"> email_test </h1>
# %u516C%u5171%u5206%u7C7B
[TOC]
# tag
[TOC]
## %28tag%29%u6839%u636E%u6709%u89C4%u5219%u7684%u6807%u7B7E%u5217%u8868%u6807%u7B7E%0A%3Ca%20id%3D%28tag%29%u6839%u636E%u6709%u89C4%u5219%u7684%u6807%u7B7E%u5217%u8868%u6807%u7B7E%3E%20%3C/a%3E
[TOC]
### 基本信息
**Path** /api/tag/get_rule_tag_list22
**Method** POST
**接口描述:**
<p>(tag)根据有规则的标签列表标签qqqwwwwww他吞吞吐吐vvvvvvvv</p>
<p>ddd</p>
### 请求参数
**Headers**
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| Content-Type | application/json | 是 | | |
| SiteUID | | 是 | | |
| ClientId | | 是 | | |
| Token | | 是 | | 请求令牌 |
**Query**
| 参数名称 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ |
| page_num | 是 | | 页码数 |
| page_size | 是 | | 一页数据数量 |
**Body**
```javascript
{
"id": "@integer",
"name1": "@string",
"tag_group_id": "@integer",
"type": "@integer",
"type1": "@integer",
"type3": "@integer",
"type4": "@email"
}
```
### 返回数据
```javascript
{
"code": "@string",
"info": {
"data": [
{
"id_11": "@integer",
"name": "@string",
"weight": "@integer",
"is_show": "@integer",
"type": "@integer",
"is_automatic_update": "@integer",
"product_count": "@integer",
"insert_time": "@string",
"tag_group_1": [
{
"id": "@integer",
"name": "@string",
"insert_time": "@string"
}
]
}
],
"meta": {
"count": "@integer"
}
},
"msg": "@string"
}
```
# test
[TOC]

View File

@ -71,7 +71,7 @@ class ProjectCard extends Component {
<Card bordered={false} className="m-card" onClick={() => this.props.history.push('/project/' + (projectData.projectid || projectData._id))}>
<Icon type={projectData.icon || 'star-o'} className="ui-logo" style={{ backgroundColor: constants.PROJECT_COLOR[projectData.color] || constants.PROJECT_COLOR.blue }} />
<h4 className="ui-title">{projectData.name || projectData.projectname}</h4>
</Card>
</Card>
<div className="card-btns" onClick={projectData.follow || inFollowPage ? this.del : this.add}>
<Tooltip placement="rightTop" title={projectData.follow || inFollowPage ? '取消关注' : '添加关注'}>
<Icon type={projectData.follow || inFollowPage ? 'star' : 'star-o'} className={'icon ' + (projectData.follow || inFollowPage ? 'active' : '')}/>

View File

@ -78,6 +78,13 @@
overflow: hidden;
text-overflow: ellipsis;
}
.btnwrap-changeproject {
text-align: center;
padding: .16rem 0;
background: #fff;
background-color: #fff;
margin: 0 -.4rem;
background-size: 4px 4px;
}
}

View File

@ -203,7 +203,7 @@ class ProjectMessage extends Component {
</Col>
</Row>
<hr className="breakline" />
<Form>
<Form>
<FormItem
{...formItemLayout}
label="项目ID"

View File

@ -14,7 +14,7 @@ const columns = [
key: 'project'
},
{
title: '分组',
title: '接口',
dataIndex: 'interface',
key: 'interface'
},

View File

@ -79,7 +79,7 @@ class interfaceController extends baseController {
}
this.schemaMap = {
add: Object.assign({
add: Object.assign({
'*project_id': 'number',
'*path': minLengthStringField,
'*title': minLengthStringField,
@ -1014,6 +1014,49 @@ class interfaceController extends baseController {
}
// 获取开放接口数据
async listByOpen(ctx) {
let project_id = ctx.request.query.project_id;
if (!project_id) {
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
}
let project = await this.projectModel.getBaseInfo(project_id);
if (!project) {
return ctx.body = yapi.commons.resReturn(null, 406, '不存在的项目');
}
if (project.project_type === 'private') {
if (await this.checkAuth(project._id, 'project', 'view') !== true) {
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
}
}
let basepath = project.basepath;
try {
let result = await this.catModel.list(project_id), newResult = [];
for (let i = 0, item, list; i < result.length; i++) {
item = result[i].toObject()
list = await this.Model.listByInterStatus(item._id, 'open')
for (let j = 0; j < list.length; j++) {
list[j] = list[j].toObject();
list[j].basepath = basepath
}
newResult = [].concat(newResult, list)
}
ctx.body = yapi.commons.resReturn(newResult);
} catch (err) {
ctx.body = yapi.commons.resReturn(null, 402, err.message);
}
}
}

View File

@ -206,6 +206,7 @@ class interfaceModel extends baseModel {
}
listByInterStatus(catid, status){
let option ={}
if(status === 'open') {
option = {
@ -218,6 +219,7 @@ class interfaceModel extends baseModel {
}
}
return this.model.find(option)
.select()
.sort({ title: 1 })
.exec();
}

View File

@ -302,7 +302,12 @@ let routerConfig = {
action: 'listByMenu',
path: 'list_menu',
method: 'get'
}, {
}, {
action: 'listByOpen',
path: 'list_open',
method: 'get'
},
{
action: 'addCat',
path: 'add_cat',
method: 'post'

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.