fix: fix project interface bug and change app.js to App.js

This commit is contained in:
sean 2017-07-21 10:03:34 +08:00
parent 2f8a53d139
commit 6d4948503e
5 changed files with 7 additions and 6 deletions

View File

@ -3,7 +3,7 @@ import 'babel-polyfill'
import thunkMiddleware from 'redux-thunk'
import promiseMiddleware from 'redux-promise';
import ReactDOM from 'react-dom'
import App from './App'
import App from './app'
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import ReduxContainer from './ReduxContainer.js'

View File

@ -25,7 +25,7 @@ class projectController extends baseController {
}
verifyPath(path){
if(/^[a-zA-Z0-9\-\/_:]+$/.test(basepath)){
if(/^[a-zA-Z0-9\-\/_:]+$/.test(path)){
return true;
}else{
return false;
@ -78,7 +78,7 @@ class projectController extends baseController {
return ctx.body = yapi.commons.resReturn(null, 400, '项目domain不能为空');
}
if(params.basepath = (this.handleBasepath(params.basepath)) === false){
if((params.basepath = this.handleBasepath(params.basepath)) === false){
return ctx.body = yapi.commons.resReturn(null, 401, 'basepath格式有误')
}
@ -90,7 +90,6 @@ class projectController extends baseController {
if(checkRepeatDomain > 0){
return ctx.body = yapi.commons.resReturn(null, 401, '已存在domain和basepath');
}
let data = {
name: params.name,

View File

@ -12,6 +12,7 @@ class projectModel extends baseModel{
name: {type: String, required: true},
basepath: {type: String, required: true, validate: {
validator: (v) => {
console.log('basepath: ', v)
return v && v[0] === '/'
},
message: 'basepath必须是/开头'

View File

@ -85,7 +85,7 @@ var projectController = function (_baseController) {
}, {
key: 'verifyPath',
value: function verifyPath(path) {
if (/^[a-zA-Z0-9\-\/_:]+$/.test(basepath)) {
if (/^[a-zA-Z0-9\-\/_:]+$/.test(path)) {
return true;
} else {
return false;
@ -174,7 +174,7 @@ var projectController = function (_baseController) {
return _context.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(null, 400, '项目domain不能为空'));
case 14:
if (!(params.basepath = this.handleBasepath(params.basepath) === false)) {
if (!((params.basepath = this.handleBasepath(params.basepath)) === false)) {
_context.next = 16;
break;
}

View File

@ -51,6 +51,7 @@ var projectModel = function (_baseModel) {
name: { type: String, required: true },
basepath: { type: String, required: true, validate: {
validator: function validator(v) {
console.log('basepath: ', v);
return v && v[0] === '/';
},
message: 'basepath必须是/开头'