mirror of
https://github.com/YMFE/yapi.git
synced 2025-03-07 14:16:52 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
7fe29ba83c
@ -7,6 +7,8 @@ exports.formatTime = (timestamp) => {
|
||||
return moment.unix(timestamp).format("YYYY-MM-DD HH:mm:ss")
|
||||
}
|
||||
|
||||
// 获取 YAPI LOGO 的 SVG
|
||||
// 参数 length 为 svg 的直径。
|
||||
exports.logoSVG = (length) => (<svg className="svg" width={length} height={length} viewBox="0 0 64 64" version="1.1">
|
||||
<title>Icon</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
@ -38,6 +40,10 @@ exports.logoSVG = (length) => (<svg className="svg" width={length} height={lengt
|
||||
</g>
|
||||
</svg>);
|
||||
|
||||
// 防抖函数,减少高频触发的函数执行的频率
|
||||
// 请在 constructor 里使用:
|
||||
// import { debounce } from '$/common';
|
||||
// this.func = debounce(this.func, 400);
|
||||
exports.debounce = (func, wait) => {
|
||||
let timeout;
|
||||
return function() {
|
||||
@ -45,3 +51,12 @@ exports.debounce = (func, wait) => {
|
||||
timeout = setTimeout(func, wait);
|
||||
};
|
||||
};
|
||||
|
||||
// 从 Javascript 对象中选取随机属性
|
||||
exports.pickRandomProperty = (obj) => {
|
||||
let result;
|
||||
let count = 0;
|
||||
for (let prop in obj)
|
||||
if (Math.random() < 1/++count) result = prop;
|
||||
return result;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import { delFollow, addFollow } from '../../reducer/modules/follow';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router';
|
||||
import { debounce } from '../../common';
|
||||
import constants from '../../constants/variable.js';
|
||||
|
||||
@connect(
|
||||
state => {
|
||||
@ -57,7 +58,6 @@ class ProjectCard extends Component {
|
||||
color: projectData.color
|
||||
}
|
||||
this.props.addFollow(param).then((res) => {
|
||||
console.log(res);
|
||||
if (res.payload.data.errcode === 0) {
|
||||
this.props.callbackResult();
|
||||
// message.success('已添加关注!'); // 星号已做出反馈 无需重复提醒用户
|
||||
@ -70,7 +70,7 @@ class ProjectCard extends Component {
|
||||
return (
|
||||
<div className="card-container">
|
||||
<Card bordered={false} className="m-card" onClick={() => this.props.history.push('/project/' + projectData._id)}>
|
||||
<Icon type={projectData.icon || 'star-o'} className="ui-logo" style={{backgroundColor: projectData.color || '#2395f1'}} />
|
||||
<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>
|
||||
<div className="card-btns" onClick={projectData.follow || inFollowPage ? this.del : this.add}>
|
||||
|
@ -22,7 +22,59 @@ export default {
|
||||
'PATCH': {
|
||||
request_body: true
|
||||
}
|
||||
}
|
||||
},
|
||||
PROJECT_COLOR: {
|
||||
blue: '#2395f1',
|
||||
green: '#57cf27',
|
||||
yellow: '#fac200',
|
||||
red: '#ff561b',
|
||||
pink: '#f5317f',
|
||||
cyan: '#00a2ae',
|
||||
gray: '#bfbfbf',
|
||||
purple: '#7265e6'
|
||||
},
|
||||
PROJECT_ICON: [
|
||||
'code-o',
|
||||
'swap',
|
||||
'clock-circle-o',
|
||||
'unlock',
|
||||
'calendar',
|
||||
'play-circle-o',
|
||||
'file-text',
|
||||
'desktop',
|
||||
'hdd',
|
||||
'appstore-o',
|
||||
'line-chart',
|
||||
'mail',
|
||||
'mobile',
|
||||
'notification',
|
||||
'picture',
|
||||
'poweroff',
|
||||
'search',
|
||||
'setting',
|
||||
'share-alt',
|
||||
'shopping-cart',
|
||||
'tag-o',
|
||||
'video-camera',
|
||||
'cloud-o',
|
||||
'star-o',
|
||||
'environment-o',
|
||||
'camera-o',
|
||||
'team',
|
||||
'customer-service',
|
||||
'pay-circle-o',
|
||||
'rocket',
|
||||
'database',
|
||||
'tool',
|
||||
'wifi',
|
||||
'idcard',
|
||||
'medicine-box',
|
||||
'coffee',
|
||||
'safety',
|
||||
'global',
|
||||
'api',
|
||||
'fork',
|
||||
'android-o',
|
||||
'apple-o'
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,6 +9,8 @@ const { TextArea } = Input;
|
||||
const FormItem = Form.Item;
|
||||
const Option = Select.Option;
|
||||
const RadioGroup = Radio.Group;
|
||||
import { pickRandomProperty } from '../../common';
|
||||
import constants from '../../constants/variable.js';
|
||||
import { withRouter } from 'react-router';
|
||||
import './Addproject.scss';
|
||||
|
||||
@ -62,6 +64,8 @@ class ProjectList extends Component {
|
||||
if (!err) {
|
||||
values.group_id = values.group.split(':')[0];
|
||||
values.group_name = values.group.split(':')[1];
|
||||
values.icon = constants.PROJECT_ICON[0];
|
||||
values.color = pickRandomProperty(constants.PROJECT_COLOR);
|
||||
delete values.group;
|
||||
addProject(values).then((res) => {
|
||||
if (res.payload.data.errcode == 0) {
|
||||
|
@ -48,14 +48,61 @@
|
||||
.logbidden{
|
||||
color: #c0c1c1;
|
||||
cursor: default;
|
||||
line-height: 30px;
|
||||
padding-left: 30px;
|
||||
padding: 8px !important;
|
||||
}
|
||||
.loggetMore{
|
||||
line-height: 30px;
|
||||
padding-left: 30px;
|
||||
color: #4eaef3;
|
||||
}
|
||||
|
||||
.ant-timeline-item{
|
||||
&:after{
|
||||
content: "";
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.ant-timeline-item-content{
|
||||
background-color: #ececec;
|
||||
float: left;
|
||||
width: auto;
|
||||
margin-left: 40px;
|
||||
padding: 0px;
|
||||
padding-bottom: 16px;
|
||||
min-width: 300px;
|
||||
border-radius: 8px;
|
||||
|
||||
.logMesHeade{
|
||||
color: white;
|
||||
padding: 16px 8px 8px 8px;
|
||||
background-color: gray;
|
||||
border-top-left-radius: 8px;
|
||||
border-top-right-radius: 8px;
|
||||
}
|
||||
.logoTimeago{
|
||||
left: -120px;
|
||||
}
|
||||
.logcontent{
|
||||
text-indent: 2em;
|
||||
line-height: 1.5em;
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.ant-timeline-item-pending{
|
||||
padding: 0px;
|
||||
.ant-timeline-item-content{
|
||||
padding: 0px;
|
||||
min-width: auto;
|
||||
.loggetMore{
|
||||
margin: 0px;
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.logHead{
|
||||
height: 80px;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Timeline, Spin, Avatar } from 'antd'
|
||||
import { Timeline, Spin, Avatar,Icon } from 'antd'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
import { formatTime } from '../../../../common.js';
|
||||
@ -57,7 +57,6 @@ function timeago(timestamp) {
|
||||
|
||||
@connect(
|
||||
state => {
|
||||
console.log(state);
|
||||
return {
|
||||
newsData: state.news.newsData,
|
||||
curpage: state.news.curpage,
|
||||
@ -112,14 +111,24 @@ class TimeTree extends Component {
|
||||
|
||||
render() {
|
||||
let data = this.props.newsData ? this.props.newsData.list : [];
|
||||
let logType = {
|
||||
project: "项目",
|
||||
group: "分组",
|
||||
interface: "接口",
|
||||
interface_col: "接口集",
|
||||
user: "用户",
|
||||
other: "其他"
|
||||
};
|
||||
if (data && data.length) {
|
||||
|
||||
data = data.map(function (item, i) {
|
||||
return (<Timeline.Item dot={<Avatar src={`/api/user/avatar?uid=${item.uid}`} />} key={i}>
|
||||
<span className="logoTimeago">{timeago(item.add_time)}</span>
|
||||
<span className="logusername"><Link to={`/user/profile/${item.uid}`}>{item.username}</Link></span>
|
||||
<span className="logtype">{item.type}</span>
|
||||
<span className="logtime">{formatTime(item.add_time)}</span>
|
||||
<div className="logMesHeade">
|
||||
<span className="logoTimeago">{timeago(item.add_time)}</span>
|
||||
<span className="logusername"><Link to={`/user/profile/${item.uid}`}><Icon type="user" />{item.username}</Link></span>
|
||||
<span className="logtype">{logType[item.type]}动态</span>
|
||||
<span className="logtime">{formatTime(item.add_time)}</span>
|
||||
</div>
|
||||
<span className="logcontent">{item.content}</span>
|
||||
</Timeline.Item>);
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ class View extends Component {
|
||||
if(req_body_type === 'json'){
|
||||
return <div style={{display:this.props.curData.req_body_other?"block":"none"}} className="colBody">
|
||||
<span className="colKey">请求Body:</span>
|
||||
<div id="vreq_body_json" style={{ minHeight: "300px" }}></div>
|
||||
<div id="vreq_body_json" style={{ minHeight: "200px" }}></div>
|
||||
</div>
|
||||
|
||||
}else if(req_body_type === 'form'){
|
||||
@ -89,7 +89,7 @@ class View extends Component {
|
||||
if(res_body_type === 'json'){
|
||||
return <div style={{display:this.props.curData.res_body?"":"none"}} className="colBody">
|
||||
<span className="colKey">返回Body:</span>
|
||||
<div id="vres_body_json" style={{ minHeight: "300px" }}></div>
|
||||
<div id="vres_body_json" style={{ minHeight: "200px" }}></div>
|
||||
</div>
|
||||
}else if(res_body_type === 'raw'){
|
||||
return <div style={{display:this.props.curData.res_body?"":"none"}} className="colBody">
|
||||
@ -238,7 +238,7 @@ class View extends Component {
|
||||
</div>
|
||||
<div className="colMockUrl">
|
||||
<span className="colKey">Mock地址:</span>
|
||||
<span className="colValue">{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}/yourPath`}</span>
|
||||
<span className="colValue">{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}/${this.props.curData.path}`}</span>
|
||||
</div>
|
||||
{this.props.curData.desc?<div className="colDesc">
|
||||
<span className="colKey">接口描述:</span>
|
||||
|
@ -35,6 +35,10 @@
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
}
|
||||
.colDesc{
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.ant-table-thead {
|
||||
th{
|
||||
color: #6d6c6c;
|
||||
@ -75,6 +79,7 @@
|
||||
.colMockUrl{
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 0px;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.colDesc{
|
||||
line-height: 1.5em;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Form, Input, Icon, Tooltip, Select, Button, Row, Col, message, Card, Radio, Alert, Modal, Popover } from 'antd';
|
||||
import PropTypes from 'prop-types';
|
||||
import { updateProject, delProject, getProjectMsg } from '../../../../reducer/modules/project';
|
||||
import { updateProject, delProject, getProjectMsg, upsetProject } from '../../../../reducer/modules/project';
|
||||
import { fetchGroupMsg } from '../../../../reducer/modules/group';
|
||||
import { connect } from 'react-redux';
|
||||
const { TextArea } = Input;
|
||||
@ -9,9 +9,10 @@ import { withRouter } from 'react-router';
|
||||
const FormItem = Form.Item;
|
||||
const Option = Select.Option;
|
||||
const RadioGroup = Radio.Group;
|
||||
const RadioButton = Radio.Button;
|
||||
import constants from '../../../../constants/variable.js';
|
||||
const confirm = Modal.confirm;
|
||||
import '../Setting.scss';
|
||||
|
||||
// layout
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
@ -39,7 +40,8 @@ let uuid = 0; // 环境配置的计数
|
||||
updateProject,
|
||||
delProject,
|
||||
getProjectMsg,
|
||||
fetchGroupMsg
|
||||
fetchGroupMsg,
|
||||
upsetProject
|
||||
}
|
||||
)
|
||||
@withRouter
|
||||
@ -60,6 +62,7 @@ class ProjectMessage extends Component {
|
||||
getProjectMsg: PropTypes.func,
|
||||
history: PropTypes.object,
|
||||
fetchGroupMsg: PropTypes.func,
|
||||
upsetProject: PropTypes.func,
|
||||
projectList: PropTypes.array,
|
||||
projectMsg: PropTypes.object
|
||||
}
|
||||
@ -166,6 +169,25 @@ class ProjectMessage extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
// 修改项目头像的背景颜色
|
||||
changeProjectColor = (e) => {
|
||||
const { _id, color, icon } = this.props.projectMsg;
|
||||
this.props.upsetProject({ id: _id, color: e.target.value || color, icon }).then((res) => {
|
||||
if (res.payload.data.errcode === 0) {
|
||||
this.props.getProjectMsg(this.props.projectId);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 修改项目头像的图标
|
||||
changeProjectIcon = (e) => {
|
||||
const { _id, color, icon } = this.props.projectMsg;
|
||||
this.props.upsetProject({ id: _id, color, icon: e.target.value || icon }).then((res) => {
|
||||
if (res.payload.data.errcode === 0) {
|
||||
this.props.getProjectMsg(this.props.projectId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async componentWillMount() {
|
||||
await this.props.getProjectMsg(this.props.projectId);
|
||||
const groupMsg = await this.props.fetchGroupMsg(this.props.projectMsg.group_id);
|
||||
@ -177,7 +199,6 @@ class ProjectMessage extends Component {
|
||||
render () {
|
||||
const { getFieldDecorator, getFieldValue } = this.props.form;
|
||||
const { projectMsg } = this.props;
|
||||
console.log(projectMsg);
|
||||
let initFormValues = {};
|
||||
let envMessage = [];
|
||||
const { name, basepath, desc, env, project_type } = projectMsg;
|
||||
@ -285,19 +306,23 @@ class ProjectMessage extends Component {
|
||||
</Row>
|
||||
);
|
||||
});
|
||||
|
||||
const colorSelector = (<RadioGroup onChange={this.onChange} value={1}>
|
||||
<Radio value={1} style={{color: 'red'}}></Radio>
|
||||
<Radio value={2}></Radio>
|
||||
<Radio value={3}></Radio>
|
||||
<Radio value={4}></Radio>
|
||||
const colorArr = Object.entries(constants.PROJECT_COLOR);
|
||||
const colorSelector = (<RadioGroup onChange={this.changeProjectColor} value={projectMsg.color} className="color">
|
||||
{colorArr.map((item, index) => {
|
||||
return (<RadioButton key={index} value={item[0]} style={{backgroundColor: item[1], color: '#fff', fontWeight: 'bold'}}>{item[0] === projectMsg.color ? <Icon type="check" /> : null}</RadioButton>);
|
||||
})}
|
||||
</RadioGroup>);
|
||||
const iconSelector = (<RadioGroup onChange={this.changeProjectIcon} value={projectMsg.icon} className="icon">
|
||||
{constants.PROJECT_ICON.map((item) => {
|
||||
return (<RadioButton key={item} value={item} style={{fontWeight: 'bold'}}><Icon type={item} /></RadioButton>);
|
||||
})}
|
||||
</RadioGroup>);
|
||||
return (
|
||||
<div className="m-panel">
|
||||
<Row className="project-setting">
|
||||
<Col sm={6} lg={3} className="setting-logo">
|
||||
<Popover placement="bottom" title={colorSelector} content={'content'} trigger="click">
|
||||
<Icon type={projectMsg.icon || 'star-o'} className="ui-logo" style={{backgroundColor: projectMsg.color || '#2395f1'}} />
|
||||
<Popover placement="bottom" title={colorSelector} content={iconSelector} trigger="click" overlayClassName="change-project-container">
|
||||
<Icon type={projectMsg.icon || 'star-o'} className="ui-logo" style={{ backgroundColor: constants.PROJECT_COLOR[projectMsg.color] || constants.PROJECT_COLOR.blue }} />
|
||||
</Popover>
|
||||
</Col>
|
||||
<Col sm={18} lg={21} className="setting-intro">
|
||||
@ -400,9 +425,9 @@ class ProjectMessage extends Component {
|
||||
</Form>
|
||||
<Row>
|
||||
<Col sm={{ offset: 6 }} lg={{ offset: 3 }}>
|
||||
<Button className="m-btn" icon="plus" type="primary"
|
||||
<Button className="m-btn" icon="save" type="primary"
|
||||
onClick={this.handleOk}
|
||||
>修改项目</Button>
|
||||
>保存</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
@ -83,10 +83,37 @@
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
border-radius: 50%;
|
||||
font-size: .6rem;
|
||||
font-size: .5rem;
|
||||
color: #fff;
|
||||
background-color: #2395f1;
|
||||
line-height: 1rem;
|
||||
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
|
||||
}
|
||||
}
|
||||
|
||||
.change-project-container {
|
||||
max-width: 320px;
|
||||
.ant-popover-inner {
|
||||
text-align: center;
|
||||
}
|
||||
.ant-popover-title {
|
||||
padding: 8px .16rem;
|
||||
height: auto;
|
||||
}
|
||||
.ant-radio-button-wrapper {
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
&:first-child {
|
||||
border: none;
|
||||
}
|
||||
&:not(:first-child)::before {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
.ant-radio-button-wrapper-checked {
|
||||
box-shadow: none;
|
||||
color: #fff;
|
||||
background-color: #2395f1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ const PROJECT_ADD = 'yapi/project/PROJECT_ADD';
|
||||
const PROJECT_DEL = 'yapi/project/PROJECT_DEL';
|
||||
// const CHANGE_TABLE_LOADING = 'yapi/project/CHANGE_TABLE_LOADING';
|
||||
const PROJECT_UPDATE = 'yapi/project/PROJECT_UPDATE';
|
||||
const PROJECT_UPSET = 'yapi/project/PROJECT_UPSET';
|
||||
const GET_CURR_PROJECT = 'yapi/project/GET_CURR_PROJECT'
|
||||
const GET_PEOJECT_MEMBER = 'yapi/project/GET_PEOJECT_MEMBER';
|
||||
const ADD_PROJECT_MEMBER = 'yapi/project/ADD_PROJECT_MEMBER';
|
||||
@ -139,7 +140,7 @@ export function getProjectMemberList(id) {
|
||||
// }
|
||||
|
||||
export function addProject(data) {
|
||||
const { name, prd_host, basepath, desc, group_id, group_name, protocol } = data;
|
||||
const { name, prd_host, basepath, desc, group_id, group_name, protocol, icon, color } = data;
|
||||
const param = {
|
||||
name,
|
||||
prd_host,
|
||||
@ -147,7 +148,9 @@ export function addProject(data) {
|
||||
basepath,
|
||||
desc,
|
||||
group_id,
|
||||
group_name
|
||||
group_name,
|
||||
icon,
|
||||
color
|
||||
};
|
||||
return {
|
||||
type: PROJECT_ADD,
|
||||
@ -155,6 +158,7 @@ export function addProject(data) {
|
||||
};
|
||||
}
|
||||
|
||||
// 修改项目
|
||||
export function updateProject(data) {
|
||||
const { name, project_type, basepath, desc, _id, env } = data;
|
||||
const param = {
|
||||
@ -171,6 +175,15 @@ export function updateProject(data) {
|
||||
};
|
||||
}
|
||||
|
||||
// 修改项目头像
|
||||
export function upsetProject(param) {
|
||||
return {
|
||||
type: PROJECT_UPSET,
|
||||
payload: axios.post('/api/project/upset', param)
|
||||
};
|
||||
}
|
||||
|
||||
// 删除项目
|
||||
export function delProject(id) {
|
||||
const param = { id };
|
||||
return {
|
||||
|
@ -106,11 +106,32 @@ class projectController extends baseController {
|
||||
icon: params.icon,
|
||||
color: params.color,
|
||||
add_time: yapi.commons.time(),
|
||||
up_time: yapi.commons.time()
|
||||
up_time: yapi.commons.time(),
|
||||
env: [{ name: 'local', domain: 'http://127.0.0.1' }]
|
||||
};
|
||||
|
||||
try {
|
||||
let result = await this.Model.save(data);
|
||||
let colInst = yapi.getInst(interfaceColModel);
|
||||
let catInst = yapi.getInst(interfaceCatModel);
|
||||
if (result._id) {
|
||||
await colInst.save({
|
||||
name: '公共测试集',
|
||||
project_id: result._id,
|
||||
desc: '公共测试集',
|
||||
uid: this.getUid(),
|
||||
add_time: yapi.commons.time(),
|
||||
up_time: yapi.commons.time()
|
||||
})
|
||||
await catInst.save({
|
||||
name: '公共分类',
|
||||
project_id: result._id,
|
||||
desc: '公共分类',
|
||||
uid: this.getUid(),
|
||||
add_time: yapi.commons.time(),
|
||||
up_time: yapi.commons.time()
|
||||
})
|
||||
}
|
||||
let username = this.getUsername();
|
||||
yapi.commons.saveLog({
|
||||
content: `用户${username}添加了项目${params.name}`,
|
||||
@ -160,7 +181,7 @@ class projectController extends baseController {
|
||||
params.role = params.role === 'owner' ? 'owner' : 'dev';
|
||||
|
||||
let userdata = await this.getUserdata(params.member_uid, params.role);
|
||||
if(userdata === null){
|
||||
if (userdata === null) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '成员uid不存在')
|
||||
}
|
||||
|
||||
@ -217,7 +238,7 @@ class projectController extends baseController {
|
||||
let result = await this.Model.delMember(params.id, params.member_uid);
|
||||
let username = this.getUsername();
|
||||
let project = await this.Model.get(params.id);
|
||||
let member = await yapi.getInst(userModel).findById(params.member_uid);
|
||||
let member = await yapi.getInst(userModel).findById(params.member_uid);
|
||||
yapi.commons.saveLog({
|
||||
content: `用户${username}删除了项目${project.name}中的成员${member.username}`,
|
||||
type: 'project',
|
||||
@ -234,11 +255,11 @@ class projectController extends baseController {
|
||||
}
|
||||
|
||||
|
||||
async getUserdata(uid, role){
|
||||
async getUserdata(uid, role) {
|
||||
role = role || 'dev';
|
||||
let userInst = yapi.getInst(userModel);
|
||||
let userData = await userInst.findById(uid);
|
||||
if(!userData){
|
||||
if (!userData) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
@ -292,7 +313,7 @@ class projectController extends baseController {
|
||||
}
|
||||
try {
|
||||
let result = await this.Model.getBaseInfo(params.id);
|
||||
if(!result){
|
||||
if (!result) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的项目');
|
||||
}
|
||||
result = result.toObject();
|
||||
@ -324,19 +345,19 @@ class projectController extends baseController {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目分组id不能为空');
|
||||
}
|
||||
|
||||
let auth =await this.checkAuth(group_id, 'group', 'edit')
|
||||
let auth = await this.checkAuth(group_id, 'group', 'edit')
|
||||
try {
|
||||
let result = await this.Model.list(group_id, auth);
|
||||
let follow = await this.followModel.list(this.getUid());
|
||||
let uids = [];
|
||||
result.forEach((item, index) => {
|
||||
result[index] = item.toObject();
|
||||
let f = _.find(follow, (fol)=>{
|
||||
let f = _.find(follow, (fol) => {
|
||||
return fol.projectid === item._id
|
||||
})
|
||||
if(f){
|
||||
if (f) {
|
||||
result[index].follow = true;
|
||||
}else{
|
||||
} else {
|
||||
result[index].follow = false;
|
||||
}
|
||||
if (uids.indexOf(item.uid) === -1) {
|
||||
@ -404,7 +425,7 @@ class projectController extends baseController {
|
||||
* @returns {Object}
|
||||
* @example
|
||||
*/
|
||||
async changeMemberRole(ctx){
|
||||
async changeMemberRole(ctx) {
|
||||
let params = ctx.request.body;
|
||||
let projectInst = yapi.getInst(projectModel);
|
||||
if (!params.member_uid) {
|
||||
@ -454,23 +475,23 @@ class projectController extends baseController {
|
||||
* @returns {Object}
|
||||
* @example ./api/project/upset
|
||||
*/
|
||||
async upSet(ctx){
|
||||
async upSet(ctx) {
|
||||
let id = ctx.request.body.id;
|
||||
let data = {};
|
||||
data.color = ctx.request.body.color;
|
||||
data.icon = ctx.request.body.icon;
|
||||
if(!id){
|
||||
if (!id) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 405, '项目id不能为空');
|
||||
}
|
||||
try{
|
||||
try {
|
||||
let result = await this.Model.up(id, data);
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
try{
|
||||
this.followModel.updateById(this.getUid(),id,data).then();
|
||||
}catch(e){
|
||||
try {
|
||||
this.followModel.updateById(this.getUid(), id, data).then();
|
||||
} catch (e) {
|
||||
yapi.commons.log(e, 'error'); // eslint-disable-line
|
||||
}
|
||||
}
|
||||
@ -535,12 +556,12 @@ class projectController extends baseController {
|
||||
|
||||
if (params.name) data.name = params.name;
|
||||
if (params.desc) data.desc = params.desc;
|
||||
if (params.basepath ) {
|
||||
if (params.basepath) {
|
||||
data.basepath = params.basepath;
|
||||
}
|
||||
if (params.env) data.env = params.env;
|
||||
if(params.color) data.color = params.color;
|
||||
if(params.icon) data.icon = params.icon;
|
||||
if (params.color) data.color = params.color;
|
||||
if (params.icon) data.icon = params.icon;
|
||||
let result = await this.Model.up(id, data);
|
||||
let username = this.getUsername();
|
||||
yapi.commons.saveLog({
|
||||
@ -556,37 +577,37 @@ class projectController extends baseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目头像
|
||||
* @interface /project/upset
|
||||
* @method POST
|
||||
* @category project
|
||||
* @foldnumber 10
|
||||
* @param {Number} id
|
||||
* @param {String} color
|
||||
* @param {String} icon
|
||||
* @return {Object}
|
||||
*/
|
||||
async upSet(ctx){
|
||||
let id = ctx.request.body.id;
|
||||
let data = {};
|
||||
data.color = ctx.request.body.color;
|
||||
data.icon = ctx.request.body.icon;
|
||||
if(!id){
|
||||
return ctx.body = yapi.commons.resReturn(null, 405, '项目id不能为空');
|
||||
}
|
||||
try{
|
||||
let result = await this.Model.up(id, data);
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
}catch(e){
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
try{
|
||||
this.followModel.updateById(this.getUid(),id,data).then();
|
||||
}catch(e){
|
||||
yapi.commons.log(e, 'error'); // eslint-disable-line
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 修改项目头像
|
||||
* @interface /project/upset
|
||||
* @method POST
|
||||
* @category project
|
||||
* @foldnumber 10
|
||||
* @param {Number} id
|
||||
* @param {String} color
|
||||
* @param {String} icon
|
||||
* @return {Object}
|
||||
*/
|
||||
async upSet(ctx) {
|
||||
let id = ctx.request.body.id;
|
||||
let data = {};
|
||||
data.color = ctx.request.body.color;
|
||||
data.icon = ctx.request.body.icon;
|
||||
if (!id) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 405, '项目id不能为空');
|
||||
}
|
||||
try {
|
||||
let result = await this.Model.up(id, data);
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
try {
|
||||
this.followModel.updateById(this.getUid(), id, data).then();
|
||||
} catch (e) {
|
||||
yapi.commons.log(e, 'error'); // eslint-disable-line
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 模糊搜索项目名称或者组名称
|
||||
@ -663,7 +684,7 @@ class projectController extends baseController {
|
||||
return ctx.body = yapi.commons.resReturn(null, 401, '项目id不存在');
|
||||
}
|
||||
|
||||
const arr = JSON.stringify(count.map(function(item) {
|
||||
const arr = JSON.stringify(count.map(function (item) {
|
||||
// 返回的json模板数据: item.res_body
|
||||
const mockData = Mock.mock(
|
||||
yapi.commons.json_parse(item.res_body)
|
||||
@ -704,7 +725,7 @@ class projectController extends baseController {
|
||||
});
|
||||
}
|
||||
module.exports = run;`
|
||||
.trim();
|
||||
.trim();
|
||||
return ctx.body = res;
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ app.use(_router2.default.allowedMethods());
|
||||
(0, _websocket2.default)(app);
|
||||
|
||||
app.use(function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx, next) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx, next) {
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
|
@ -59,7 +59,7 @@ var baseController = function () {
|
||||
(0, _createClass3.default)(baseController, [{
|
||||
key: 'init',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var ignoreRouter;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -103,7 +103,7 @@ var baseController = function () {
|
||||
}, {
|
||||
key: 'checkLogin',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var token, uid, userInst, result, decoded;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -170,7 +170,7 @@ var baseController = function () {
|
||||
}, {
|
||||
key: 'getLoginStatus',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var result;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -222,7 +222,7 @@ var baseController = function () {
|
||||
}, {
|
||||
key: 'getProjectRole',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(id, type) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(id, type) {
|
||||
var _this = this;
|
||||
|
||||
var result, interfaceInst, interfaceData, projectInst, projectData, memberData, groupInst, groupData, groupMemberData;
|
||||
@ -379,7 +379,7 @@ var baseController = function () {
|
||||
}, {
|
||||
key: 'checkAuth',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(id, type, action) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(id, type, action) {
|
||||
var role;
|
||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
|
@ -69,7 +69,7 @@ var followController = function (_baseController) {
|
||||
(0, _createClass3.default)(followController, [{
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var uid, page, limit, result;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -134,7 +134,7 @@ var followController = function (_baseController) {
|
||||
}, {
|
||||
key: 'del',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var params, uid, checkRepeat, result;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -212,7 +212,7 @@ var followController = function (_baseController) {
|
||||
}, {
|
||||
key: 'add',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var params, uid, checkRepeat, data, result;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
|
@ -88,7 +88,7 @@ var groupController = function (_baseController) {
|
||||
(0, _createClass3.default)(groupController, [{
|
||||
key: 'get',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var params, groupInst, result;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -160,7 +160,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'add',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var params, groupUserdata, groupInst, checkRepeat, data, result;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -272,7 +272,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getUserdata',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(uid, role) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(uid, role) {
|
||||
var userInst, userData;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -333,7 +333,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addMember',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var params, groupInst, check, groupUserdata, result;
|
||||
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
||||
while (1) {
|
||||
@ -446,7 +446,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'changeMemberRole',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var params, groupInst, check, result;
|
||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
@ -547,7 +547,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getMemberList',
|
||||
value: function () {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var params, groupInst, group;
|
||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
@ -611,7 +611,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delMember',
|
||||
value: function () {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var params, groupInst, check, result;
|
||||
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
||||
while (1) {
|
||||
@ -709,7 +709,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var groupInst, result;
|
||||
return _regenerator2.default.wrap(function _callee8$(_context8) {
|
||||
while (1) {
|
||||
@ -762,7 +762,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'del',
|
||||
value: function () {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _this2 = this;
|
||||
|
||||
var groupInst, projectInst, interfaceInst, interfaceColInst, interfaceCaseInst, _id, projectList, result;
|
||||
@ -802,7 +802,7 @@ var groupController = function (_baseController) {
|
||||
projectList = _context10.sent;
|
||||
|
||||
projectList.forEach(function () {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(p) {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(p) {
|
||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||
while (1) {
|
||||
switch (_context9.prev = _context9.next) {
|
||||
@ -881,7 +881,7 @@ var groupController = function (_baseController) {
|
||||
}, {
|
||||
key: 'up',
|
||||
value: function () {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var groupInst, _id2, data, result;
|
||||
|
||||
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
||||
|
@ -105,7 +105,7 @@ var interfaceController = function (_baseController) {
|
||||
(0, _createClass3.default)(interfaceController, [{
|
||||
key: 'add',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var params, checkRepeat, data, result, username, cate;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -259,7 +259,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'get',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var params, result;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -321,7 +321,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var project_id, result;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -371,7 +371,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'listByCat',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var catid, result;
|
||||
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
||||
while (1) {
|
||||
@ -421,7 +421,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'listByMenu',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var project_id, result, newResult, i, item, list, j;
|
||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
@ -526,7 +526,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'up',
|
||||
value: function () {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var params, id, interfaceData, checkRepeat, data, result, username, cate, inter;
|
||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
@ -728,7 +728,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'del',
|
||||
value: function () {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var id, data, inter, result, username, cate;
|
||||
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
||||
while (1) {
|
||||
@ -822,7 +822,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'solveConflict',
|
||||
value: function () {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _this2 = this;
|
||||
|
||||
var id, result, userInst, userinfo, data;
|
||||
@ -905,7 +905,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addCat',
|
||||
value: function () {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var params, result, username;
|
||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||
while (1) {
|
||||
@ -986,7 +986,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upCat',
|
||||
value: function () {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var params, result, username, cate;
|
||||
return _regenerator2.default.wrap(function _callee10$(_context10) {
|
||||
while (1) {
|
||||
@ -1045,7 +1045,7 @@ var interfaceController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delCat',
|
||||
value: function () {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var id, catData, auth, cate, result, r, username;
|
||||
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
||||
while (1) {
|
||||
|
@ -74,7 +74,7 @@ var interfaceColController = function (_baseController) {
|
||||
(0, _createClass3.default)(interfaceColController, [{
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var id, result, i;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -149,7 +149,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addCol',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var params, result;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -233,7 +233,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getCaseList',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var id, inst, result;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -297,7 +297,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addCase',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var params, result;
|
||||
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
||||
while (1) {
|
||||
@ -390,7 +390,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getCase',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var id, result;
|
||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
@ -444,7 +444,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upCol',
|
||||
value: function () {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var params, result;
|
||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
@ -501,7 +501,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upCaseIndex',
|
||||
value: function () {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _this2 = this;
|
||||
|
||||
var params;
|
||||
@ -560,7 +560,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delCol',
|
||||
value: function () {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var id, colData, auth, result;
|
||||
return _regenerator2.default.wrap(function _callee8$(_context8) {
|
||||
while (1) {
|
||||
@ -637,7 +637,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delCase',
|
||||
value: function () {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var caseid, caseData, auth, result;
|
||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||
while (1) {
|
||||
|
@ -75,7 +75,7 @@ var logController = function (_baseController) {
|
||||
(0, _createClass3.default)(logController, [{
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var typeid, page, limit, type, result, count;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
|
@ -148,8 +148,8 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'add',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var params, checkRepeat, data, result, username;
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var params, checkRepeat, data, result, colInst, catInst, username;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
@ -233,7 +233,8 @@ var projectController = function (_baseController) {
|
||||
icon: params.icon,
|
||||
color: params.color,
|
||||
add_time: _yapi2.default.commons.time(),
|
||||
up_time: _yapi2.default.commons.time()
|
||||
up_time: _yapi2.default.commons.time(),
|
||||
env: [{ name: 'local', domain: 'http://127.0.0.1' }]
|
||||
};
|
||||
_context.prev = 20;
|
||||
_context.next = 23;
|
||||
@ -241,6 +242,36 @@ var projectController = function (_baseController) {
|
||||
|
||||
case 23:
|
||||
result = _context.sent;
|
||||
colInst = _yapi2.default.getInst(_interfaceCol2.default);
|
||||
catInst = _yapi2.default.getInst(_interfaceCat2.default);
|
||||
|
||||
if (!result._id) {
|
||||
_context.next = 31;
|
||||
break;
|
||||
}
|
||||
|
||||
_context.next = 29;
|
||||
return colInst.save({
|
||||
name: '公共测试集',
|
||||
project_id: result._id,
|
||||
desc: '公共测试集',
|
||||
uid: this.getUid(),
|
||||
add_time: _yapi2.default.commons.time(),
|
||||
up_time: _yapi2.default.commons.time()
|
||||
});
|
||||
|
||||
case 29:
|
||||
_context.next = 31;
|
||||
return catInst.save({
|
||||
name: '公共分类',
|
||||
project_id: result._id,
|
||||
desc: '公共分类',
|
||||
uid: this.getUid(),
|
||||
add_time: _yapi2.default.commons.time(),
|
||||
up_time: _yapi2.default.commons.time()
|
||||
});
|
||||
|
||||
case 31:
|
||||
username = this.getUsername();
|
||||
|
||||
_yapi2.default.commons.saveLog({
|
||||
@ -254,21 +285,21 @@ var projectController = function (_baseController) {
|
||||
icon: params.icon
|
||||
});
|
||||
ctx.body = _yapi2.default.commons.resReturn(result);
|
||||
_context.next = 32;
|
||||
_context.next = 39;
|
||||
break;
|
||||
|
||||
case 29:
|
||||
_context.prev = 29;
|
||||
case 36:
|
||||
_context.prev = 36;
|
||||
_context.t1 = _context['catch'](20);
|
||||
|
||||
ctx.body = _yapi2.default.commons.resReturn(null, 402, _context.t1.message);
|
||||
|
||||
case 32:
|
||||
case 39:
|
||||
case 'end':
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this, [[20, 29]]);
|
||||
}, _callee, this, [[20, 36]]);
|
||||
}));
|
||||
|
||||
function add(_x) {
|
||||
@ -292,7 +323,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addMember',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var params, check, userdata, result, username, project;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -422,7 +453,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delMember',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var params, check, result, username, project, member;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -528,7 +559,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getUserdata',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(uid, role) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(uid, role) {
|
||||
var userInst, userData;
|
||||
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
||||
while (1) {
|
||||
@ -586,7 +617,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getMemberList',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var params, project;
|
||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
@ -648,7 +679,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'get',
|
||||
value: function () {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var params, result, catInst, cat;
|
||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
@ -733,7 +764,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var group_id, auth, result, follow, uids, _users, users;
|
||||
|
||||
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
||||
@ -833,7 +864,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'del',
|
||||
value: function () {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var id, interfaceInst, interfaceColInst, interfaceCaseInst, result;
|
||||
return _regenerator2.default.wrap(function _callee8$(_context8) {
|
||||
while (1) {
|
||||
@ -926,7 +957,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'changeMemberRole',
|
||||
value: function () {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var params, projectInst, check, result, username, project, member;
|
||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||
while (1) {
|
||||
@ -1048,7 +1079,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upSet',
|
||||
value: function () {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var id, data, result;
|
||||
return _regenerator2.default.wrap(function _callee10$(_context10) {
|
||||
while (1) {
|
||||
@ -1127,7 +1158,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'up',
|
||||
value: function () {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var id, params, projectData, checkRepeat, data, result, username;
|
||||
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
||||
while (1) {
|
||||
@ -1274,7 +1305,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upSet',
|
||||
value: function () {
|
||||
var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(ctx) {
|
||||
var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(ctx) {
|
||||
var id, data, result;
|
||||
return _regenerator2.default.wrap(function _callee12$(_context12) {
|
||||
while (1) {
|
||||
@ -1347,7 +1378,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'search',
|
||||
value: function () {
|
||||
var _ref13 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(ctx) {
|
||||
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(ctx) {
|
||||
var q, projectList, groupList, projectRules, groupRules, queryList;
|
||||
return _regenerator2.default.wrap(function _callee13$(_context13) {
|
||||
while (1) {
|
||||
@ -1422,7 +1453,7 @@ var projectController = function (_baseController) {
|
||||
}, {
|
||||
key: 'download',
|
||||
value: function () {
|
||||
var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(ctx) {
|
||||
var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(ctx) {
|
||||
var project_id, interfaceInst, count, arr, fileName, res;
|
||||
return _regenerator2.default.wrap(function _callee14$(_context14) {
|
||||
while (1) {
|
||||
|
@ -99,7 +99,7 @@ var userController = function (_baseController) {
|
||||
(0, _createClass3.default)(userController, [{
|
||||
key: 'login',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var userInst, email, password, result;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -190,7 +190,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'logout',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
@ -248,7 +248,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'loginByToken',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var config, token, ret, login;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -300,7 +300,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'handleThirdLogin',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(email, username) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(email, username) {
|
||||
var user, data, passsalt, userInst;
|
||||
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
||||
while (1) {
|
||||
@ -384,7 +384,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'changePassword',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var params, userInst, user, passsalt, data, result;
|
||||
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
@ -512,7 +512,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'reg',
|
||||
value: function () {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var userInst, params, checkRepeat, passsalt, data, user;
|
||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
@ -636,7 +636,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var page, limit, userInst, user, count;
|
||||
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
||||
while (1) {
|
||||
@ -694,7 +694,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'findById',
|
||||
value: function () {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var userInst, id, result;
|
||||
return _regenerator2.default.wrap(function _callee8$(_context8) {
|
||||
while (1) {
|
||||
@ -770,7 +770,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'del',
|
||||
value: function () {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var userInst, id, result;
|
||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||
while (1) {
|
||||
@ -846,7 +846,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'update',
|
||||
value: function () {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var params, userInst, id, data, checkRepeat, result;
|
||||
return _regenerator2.default.wrap(function _callee10$(_context10) {
|
||||
while (1) {
|
||||
@ -952,7 +952,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'uploadAvatar',
|
||||
value: function () {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
|
||||
var basecode, pngPrefix, jpegPrefix, type, strLength, avatarInst, result;
|
||||
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
||||
while (1) {
|
||||
@ -1054,7 +1054,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'avatar',
|
||||
value: function () {
|
||||
var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(ctx) {
|
||||
var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(ctx) {
|
||||
var uid, avatarInst, data, dataBuffer, type;
|
||||
return _regenerator2.default.wrap(function _callee12$(_context12) {
|
||||
while (1) {
|
||||
@ -1118,7 +1118,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'search',
|
||||
value: function () {
|
||||
var _ref13 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(ctx) {
|
||||
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(ctx) {
|
||||
var q, queryList, rules, filteredRes;
|
||||
return _regenerator2.default.wrap(function _callee13$(_context13) {
|
||||
while (1) {
|
||||
@ -1190,7 +1190,7 @@ var userController = function (_baseController) {
|
||||
}, {
|
||||
key: 'project',
|
||||
value: function () {
|
||||
var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(ctx) {
|
||||
var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(ctx) {
|
||||
var _ctx$request$query, id, type, result, interfaceInst, interfaceData, projectInst, projectData, ownerAuth, devAuth, groupInst, groupData, _ownerAuth, _devAuth;
|
||||
|
||||
return _regenerator2.default.wrap(function _callee14$(_context14) {
|
||||
|
@ -47,7 +47,7 @@ function matchApi(apiPath, apiRule) {
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx, next) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx, next) {
|
||||
var hostname, config, path, paths, projectId, projectInst, project, interfaceData, newData, newpath, interfaceInst, _newData, findInterface, res;
|
||||
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
|
@ -351,7 +351,7 @@ function createAction(controller, action, path, method) {
|
||||
var _this = this;
|
||||
|
||||
router[method]("/api" + INTERFACE_CONFIG[controller].prefix + path, function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var inst;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
|
@ -26,7 +26,7 @@ function websocket(app) {
|
||||
return next(ctx);
|
||||
});
|
||||
router.get('/api/interface/solve_conflict', function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var inst;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
|
Loading…
Reference in New Issue
Block a user