mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
fix: fix project interface bug and change app.js to App.js
This commit is contained in:
parent
2f8a53d139
commit
6d4948503e
@ -3,7 +3,7 @@ import 'babel-polyfill'
|
|||||||
import thunkMiddleware from 'redux-thunk'
|
import thunkMiddleware from 'redux-thunk'
|
||||||
import promiseMiddleware from 'redux-promise';
|
import promiseMiddleware from 'redux-promise';
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import App from './App'
|
import App from './app'
|
||||||
import { createStore, combineReducers, applyMiddleware } from 'redux'
|
import { createStore, combineReducers, applyMiddleware } from 'redux'
|
||||||
import { Provider } from 'react-redux'
|
import { Provider } from 'react-redux'
|
||||||
import ReduxContainer from './ReduxContainer.js'
|
import ReduxContainer from './ReduxContainer.js'
|
||||||
|
@ -25,7 +25,7 @@ class projectController extends baseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
verifyPath(path){
|
verifyPath(path){
|
||||||
if(/^[a-zA-Z0-9\-\/_:]+$/.test(basepath)){
|
if(/^[a-zA-Z0-9\-\/_:]+$/.test(path)){
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
@ -78,7 +78,7 @@ class projectController extends baseController {
|
|||||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目domain不能为空');
|
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格式有误')
|
return ctx.body = yapi.commons.resReturn(null, 401, 'basepath格式有误')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +90,6 @@ class projectController extends baseController {
|
|||||||
if(checkRepeatDomain > 0){
|
if(checkRepeatDomain > 0){
|
||||||
return ctx.body = yapi.commons.resReturn(null, 401, '已存在domain和basepath');
|
return ctx.body = yapi.commons.resReturn(null, 401, '已存在domain和basepath');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
name: params.name,
|
name: params.name,
|
||||||
|
@ -12,6 +12,7 @@ class projectModel extends baseModel{
|
|||||||
name: {type: String, required: true},
|
name: {type: String, required: true},
|
||||||
basepath: {type: String, required: true, validate: {
|
basepath: {type: String, required: true, validate: {
|
||||||
validator: (v) => {
|
validator: (v) => {
|
||||||
|
console.log('basepath: ', v)
|
||||||
return v && v[0] === '/'
|
return v && v[0] === '/'
|
||||||
},
|
},
|
||||||
message: 'basepath必须是/开头'
|
message: 'basepath必须是/开头'
|
||||||
|
@ -85,7 +85,7 @@ var projectController = function (_baseController) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'verifyPath',
|
key: 'verifyPath',
|
||||||
value: function verifyPath(path) {
|
value: function verifyPath(path) {
|
||||||
if (/^[a-zA-Z0-9\-\/_:]+$/.test(basepath)) {
|
if (/^[a-zA-Z0-9\-\/_:]+$/.test(path)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -174,7 +174,7 @@ var projectController = function (_baseController) {
|
|||||||
return _context.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(null, 400, '项目domain不能为空'));
|
return _context.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(null, 400, '项目domain不能为空'));
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
if (!(params.basepath = this.handleBasepath(params.basepath) === false)) {
|
if (!((params.basepath = this.handleBasepath(params.basepath)) === false)) {
|
||||||
_context.next = 16;
|
_context.next = 16;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ var projectModel = function (_baseModel) {
|
|||||||
name: { type: String, required: true },
|
name: { type: String, required: true },
|
||||||
basepath: { type: String, required: true, validate: {
|
basepath: { type: String, required: true, validate: {
|
||||||
validator: function validator(v) {
|
validator: function validator(v) {
|
||||||
|
console.log('basepath: ', v);
|
||||||
return v && v[0] === '/';
|
return v && v[0] === '/';
|
||||||
},
|
},
|
||||||
message: 'basepath必须是/开头'
|
message: 'basepath必须是/开头'
|
||||||
|
Loading…
Reference in New Issue
Block a user