diff --git a/client/containers/Group/ProjectList/ProjectList.js b/client/containers/Group/ProjectList/ProjectList.js
index 81697ed1..8f49a09d 100755
--- a/client/containers/Group/ProjectList/ProjectList.js
+++ b/client/containers/Group/ProjectList/ProjectList.js
@@ -155,6 +155,7 @@ class ProjectList extends Component {
: )
}
+
return (
@@ -177,7 +178,7 @@ class ProjectList extends Component {
);
}) : } */}
{
- /owner/.test(this.props.currGroup.role) ? : projectData.length ? projectData.map((item, index) => {
+ this.props.currGroup.type === 'private' ? : projectData.length ? projectData.map((item, index) => {
return (
diff --git a/client/containers/Project/Interface/InterfaceList/View.js b/client/containers/Project/Interface/InterfaceList/View.js
index c4288ede..08dff551 100755
--- a/client/containers/Project/Interface/InterfaceList/View.js
+++ b/client/containers/Project/Interface/InterfaceList/View.js
@@ -167,11 +167,7 @@ class View extends Component {
}
}
- componentWillUpdate() {
- if (!this.props.curData.title && this.state.init) {
- this.setState({ init: false });
- }
- }
+
render() {
const dataSource = [];
if (this.props.curData.req_headers && this.props.curData.req_headers.length) {
diff --git a/server/controllers/project.js b/server/controllers/project.js
index 40e7a6ea..254e1428 100755
--- a/server/controllers/project.js
+++ b/server/controllers/project.js
@@ -180,11 +180,18 @@ class projectController extends baseController {
up_time: yapi.commons.time()
})
}
+ let uid = this.getUid();
+ // 将项目添加者变成项目组长,除admin以外
+ if (this.getRole() !== 'admin') {
+ let userdata = await this.getUserdata(uid, 'owner')
+ await this.Model.addMember(result._id, [userdata])
+
+ }
let username = this.getUsername();
yapi.commons.saveLog({
content: `${username} 添加了项目 ${params.name}`,
type: 'project',
- uid: this.getUid(),
+ uid,
username: username,
typeid: result._id
});
@@ -338,7 +345,7 @@ class projectController extends baseController {
async get(ctx) {
let params = ctx.params;
let result = await this.Model.getBaseInfo(params.id);
-
+
if (!result) {
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的项目');
}
diff --git a/server/yapi.js b/server/yapi.js
index c26153ba..8cd61dd7 100755
--- a/server/yapi.js
+++ b/server/yapi.js
@@ -13,7 +13,7 @@ const WEBROOT_LOG = path.join(WEBROOT_RUNTIME, 'log');
const WEBCONFIG = config;
fs.ensureDirSync(WEBROOT_LOG);
-console.log('mail', WEBCONFIG.mail)
+// console.log('mail', WEBCONFIG.mail)
if (WEBCONFIG.mail && WEBCONFIG.mail.enable) {
diff --git a/ykit.config.js b/ykit.config.js
index f15b3f9f..79c1a7cd 100755
--- a/ykit.config.js
+++ b/ykit.config.js
@@ -79,7 +79,9 @@ module.exports = {
],
commonsChunk: {
vendors: {
- lib: ['react', 'redux',
+ lib: [
+ 'react',
+ 'redux',
'redux-thunk',
'react-dom',
'redux-promise',
@@ -131,6 +133,10 @@ module.exports = {
baseConfig.resolve.alias.common = '/common';
baseConfig.resolve.alias.plugins = '/node_modules';
baseConfig.resolve.alias.exts = '/exts';
+
+ // baseConfig.resolve.alias.react = 'anujs';
+ // baseConfig.resolve.alias['react-dom'] = 'anujs';
+
baseConfig.output.prd.path = 'static/prd';
baseConfig.output.prd.publicPath = '';
baseConfig.output.prd.filename = '[name]@[chunkhash][ext]'