Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
wenbo.dong 2017-08-10 21:23:50 +08:00
commit dd8f48587f
30 changed files with 431 additions and 311 deletions

210
.tags
View File

@ -61,48 +61,11 @@ fetchMoreNews /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/news/news.js
const.curUid /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/user/user.js /^const initialState = {$/;" property line:4
switch /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/user/user.js /^ switch (action.type) {$/;" function line:9
changeCurUid /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/user/user.js /^export function changeCurUid(curUid) {$/;" function line:23
requireAuthentication /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^export function requireAuthentication(Component) {$/;" function line:16
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ constructor(props){$/;" function line:18
static.isAuthenticated /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ static propTypes ={$/;" property line:21
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ componentWillMount() {$/;" function line:28
componentWillReceiveProps /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ componentWillReceiveProps() {$/;" function line:31
checkAuth /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ checkAuth() {$/;" function line:34
render /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ render() {$/;" function line:40
MenuUser.propTypes.user /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^MenuUser.propTypes={$/;" property line:27
ToolUser.propTypes.user /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ToolUser.propTypes={$/;" property line:59
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ constructor(props) {$/;" function line:89
static.router /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ static propTypes ={$/;" property line:92
render /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ render () {$/;" function line:149
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Search/Search.js /^ constructor(props){$/;" function line:24
state.dataSource /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Search/Search.js /^ this.state = {$/;" property line:26
static.groupList /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Search/Search.js /^ static propTypes = {$/;" property line:31
getDataSource /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Search/Search.js /^ getDataSource(groupList){$/;" function line:91
render /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Search/Search.js /^ render(){$/;" function line:99
@connect.url /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ static propTypes = {$/;" property line:58
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ constructor (props) {$/;" function line:75
constructor.state.isLoading /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ this.state = {$/;" property line:77
constructor.state.isSave /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ isLoading: '',$/;" property line:78
constructor.state.mockJson /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ isSave: false,$/;" property line:79
constructor.state.mockURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ mockJson: '',$/;" property line:80
constructor.state.projectData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ mockURL: '',$/;" property line:81
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ componentDidMount () {$/;" function line:88
getInterfaceId /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ getInterfaceId () {$/;" function line:121
modifyTagName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ modifyTagName (tagName) {$/;" function line:134
verificationURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ verificationURL () {$/;" function line:140
getMockURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ getMockURL (project_id, result) {$/;" function line:148
getMockURL.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ const params = {id: project_id}$/;" property line:149
editState /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ editState (data) {$/;" function line:161
initInterfaceData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ initInterfaceData (interfaceId) {$/;" function line:177
initInterfaceData.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ const params = { id: interfaceId }$/;" property line:178
initInterfaceDataTwo /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ initInterfaceDataTwo (interfaceId) {$/;" function line:198
initInterfaceDataTwo.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ const params = { id: interfaceId }$/;" property line:199
setLoading /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ setLoading (boolean) {$/;" function line:211
routerPage /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ routerPage () {$/;" function line:217
changeState /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ changeState (ifTrue) {$/;" function line:223
mockData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ mockData () { \/\/ mock 数据$/;" function line:230
jumpEditUrl /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ jumpEditUrl (_id) {$/;" function line:244
saveForms /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ saveForms () {$/;" function line:255
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ render () {$/;" function line:308
@connect.reqParams /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/InterfaceTest/InterfaceTest.js /^ static propTypes = {$/;" property line:33
state.res /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/InterfaceTest/InterfaceTest.js /^ state = {$/;" property line:43
state.method /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/InterfaceTest/InterfaceTest.js /^ res: '',$/;" property line:44
@ -174,23 +137,6 @@ rhymeCompleter.identifierRegexps /Users/qitmac000445/Desktop/YAPI/yapi/client/co
getCompletions /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/ResParams/ResParams.js /^ getCompletions: function (editor, session, pos, prefix, callback) {$/;" function line:72
callback /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/ResParams/ResParams.js /^ callback(null, wordList.map(function (ea) {$/;" function line:94
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/ResParams/ResParams.js /^ render() {$/;" function line:113
const.y /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.opacity /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.type /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.ease /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.y /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.opacity /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.type /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.ease /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.duration /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.width /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const style = {$/;" property line:17
const.background /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ 'width':'100%',$/;" property line:20
const.backgroundSize /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ 'background': 'url(.\/image\/bg-img.jpg) no-repeat',$/;" property line:21
HomeGuest.propTypes.introList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^HomeGuest.propTypes ={$/;" property line:125
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ constructor(props) {$/;" function line:139
static.introList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ static propTypes = {$/;" property line:142
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ render () {$/;" function line:150
Home.defaultProps.introList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^Home.defaultProps={$/;" property line:174
from.fetchInterfaceData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Interface/Interface.js /^ static propTypes = {$/;" property line:34
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Interface/Interface.js /^ constructor(props) {$/;" function line:43
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Interface/Interface.js /^ componentWillMount () {$/;" function line:47
@ -203,29 +149,6 @@ deleteInterfaceData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Inte
deleteInterface /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Interface/InterfaceTable/InterfaceTable.js /^ deleteInterface (interfaceId) {$/;" function line:50
deleteInterface.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Interface/InterfaceTable/InterfaceTable.js /^ const params = {$/;" property line:51
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Interface/InterfaceTable/InterfaceTable.js /^ render () {$/;" function line:63
import.marginBottom /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^const formItemStyle = {$/;" property line:9
const.height /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^const changeHeight = {$/;" property line:13
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ constructor(props) {$/;" function line:29
static.form /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ componentDidMount() {$/;" function line:56
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ render() {$/;" function line:61
const.marginBottom /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^const formItemStyle = {$/;" property line:8
const.height /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^const changeHeight = {$/;" property line:12
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ constructor(props) {$/;" function line:28
state.confirmDirty /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ this.state = {$/;" property line:30
static.form /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ static propTypes = {$/;" property line:35
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ render() {$/;" function line:80
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ constructor(props) {$/;" function line:23
from.state.loading /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ this.state = {$/;" property line:25
static.newsData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ static propTypes = {$/;" property line:29
setLoading /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ setLoading(bool){$/;" function line:34
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ componentWillMount(){$/;" function line:39
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ render () {$/;" function line:45
@connect.fetchNewsData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ static propTypes = {$/;" property line:34
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ constructor(props) {$/;" function line:40
constructor.state.selectedKeys /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ this.state = {$/;" property line:42
getLogData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ getLogData(e){$/;" function line:46
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ render () {$/;" function line:59
from /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsTimeline/NewsTimeline.js /^import { fetchMoreNews } from '..\/..\/..\/reducer\/modules\/news.js'$/;" function line:5
@connect.newsData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsTimeline/NewsTimeline.js /^ static propTypes = {$/;" property line:22
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsTimeline/NewsTimeline.js /^ constructor(props) {$/;" function line:29
@ -408,12 +331,133 @@ searchGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/ProjectGroup
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/ProjectGroups/GroupList/GroupList.js /^ render () {$/;" function line:185
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ constructor(props) {$/;" function line:10
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ render () {$/;" function line:14
from.children /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ static propTypes = {$/;" property line:6
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ constructor(props) {$/;" function line:13
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ componentWillMount() {$/;" function line:17
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ render () {$/;" function line:20
const.isLogin /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^const initialState = {$/;" property line:15
const.userName /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ isLogin: false,$/;" property line:16
const.uid /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ userName: null,$/;" property line:17
const.email /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ uid: null,$/;" property line:18
const.loginState /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ email: '',$/;" property line:19
const.loginWrapActiveKey /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ loginState: LOADING_STATUS,$/;" property line:20
switch /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ switch (action.type) {$/;" function line:25
checkLoginState /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^export function checkLoginState() {$/;" function line:82
loginActions /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^export function loginActions(data) {$/;" function line:95
regActions /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^export function regActions(data) {$/;" function line:102
const.username /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^ password,$/;" property line:106
logoutActions /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^export function logoutActions() {$/;" function line:115
loginTypeAction /Users/qitmac000445/Desktop/YAPI/yapi/client/reducer/modules/user.js /^export function loginTypeAction(index) {$/;" function line:122
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ constructor(props) {$/;" function line:26
state.login /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ this.state = {$/;" property line:28
static.checkLoginState /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ componentDidMount() {$/;" function line:38
render /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ render() {$/;" function line:71
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ componentDidMount() {$/;" function line:45
render /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ render() {$/;" function line:78
const.height /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^const headerStyle = {$/;" property line:13
const.lineHeight /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ 'height': '.56rem',$/;" property line:14
const.padding /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ 'lineHeight': '.56rem',$/;" property line:15
MenuUser.propTypes.user /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^MenuUser.propTypes={$/;" property line:34
ToolUser.propTypes.user /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ToolUser.propTypes={$/;" property line:78
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ constructor(props) {$/;" function line:107
static.router /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ static propTypes ={$/;" property line:110
render /Users/qitmac000445/Desktop/YAPI/yapi/client/components/Header/Header.js /^ render () {$/;" function line:166
import.marginBottom /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^const formItemStyle = {$/;" property line:9
const.height /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^const changeHeight = {$/;" property line:13
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ constructor(props) {$/;" function line:29
static.form /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ componentDidMount() {$/;" function line:56
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Login.js /^ render() {$/;" function line:61
const.marginBottom /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^const formItemStyle = {$/;" property line:8
const.height /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^const changeHeight = {$/;" property line:12
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ constructor(props) {$/;" function line:28
state.confirmDirty /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ this.state = {$/;" property line:30
static.form /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ static propTypes = {$/;" property line:35
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/Reg.js /^ render() {$/;" function line:80
requireAuthentication /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^export function requireAuthentication(Component) {$/;" function line:16
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ constructor(props){$/;" function line:18
static.isAuthenticated /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ static propTypes ={$/;" property line:21
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ componentWillMount() {$/;" function line:28
componentWillReceiveProps /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ componentWillReceiveProps() {$/;" function line:31
checkAuth /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ checkAuth() {$/;" function line:34
render /Users/qitmac000445/Desktop/YAPI/yapi/client/components/AuthenticatedComponent.js /^ render() {$/;" function line:40
const.y /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.opacity /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.type /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.ease /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };$/;" property line:15
const.y /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.opacity /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.type /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.ease /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.duration /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};$/;" property line:16
const.width /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^const style = {$/;" property line:17
const.background-color /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ 'width':'100%',$/;" property line:18
const.backgroundSize /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ 'background-color': '#333',$/;" property line:20
HomeGuest.propTypes.introList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^HomeGuest.propTypes ={$/;" property line:124
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ constructor(props) {$/;" function line:138
static.introList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ static propTypes = {$/;" property line:141
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^ render () {$/;" function line:149
Home.defaultProps.introList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Home/Home.js /^Home.defaultProps={$/;" property line:173
@connect.url /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ static propTypes = {$/;" property line:58
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ constructor (props) {$/;" function line:75
constructor.state.isLoading /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ this.state = {$/;" property line:77
constructor.state.isSave /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ isLoading: '',$/;" property line:78
constructor.state.mockJson /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ isSave: false,$/;" property line:79
constructor.state.mockURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ mockJson: '',$/;" property line:80
constructor.state.projectData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ mockURL: '',$/;" property line:81
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ componentDidMount () {$/;" function line:88
getInterfaceId /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ getInterfaceId () {$/;" function line:121
modifyTagName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ modifyTagName (tagName) {$/;" function line:134
verificationURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ verificationURL () {$/;" function line:140
getMockURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ getMockURL (project_id, result) {$/;" function line:148
getMockURL.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ const params = {id: project_id}$/;" property line:149
editState /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ editState (data) {$/;" function line:161
initInterfaceData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ initInterfaceData (interfaceId) {$/;" function line:177
initInterfaceData.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ const params = { id: interfaceId }$/;" property line:178
initInterfaceDataTwo /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ initInterfaceDataTwo (interfaceId) {$/;" function line:198
initInterfaceDataTwo.id /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ const params = { id: interfaceId }$/;" property line:199
setLoading /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ setLoading (boolean) {$/;" function line:211
routerPage /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ routerPage () {$/;" function line:217
changeState /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ changeState (ifTrue) {$/;" function line:223
mockData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ mockData () { \/\/ mock 数据$/;" function line:230
jumpEditUrl /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ jumpEditUrl (_id) {$/;" function line:244
saveForms /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ saveForms () {$/;" function line:255
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/AddInterface/AddInterface.js /^ render () {$/;" function line:308
from.groupList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ static propTypes = {$/;" property line:35
state.addGroupModalVisible /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ state = {$/;" property line:46
state.editGroupModalVisible /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ addGroupModalVisible: false,$/;" property line:47
state.newGroupName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ editGroupModalVisible: false,$/;" property line:48
state.newGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ newGroupName: '',$/;" property line:49
state.currGroupName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ newGroupDesc: '',$/;" property line:50
state.currGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ currGroupName: '',$/;" property line:51
state.groupList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ currGroupDesc: '',$/;" property line:52
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ constructor(props) {$/;" function line:56
showModal /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ showModal(type) {$/;" function line:80
hideModal /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ hideModal(type) {$/;" function line:95
inputNewGroupName /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ inputNewGroupName(e, type) {$/;" function line:134
inputNewGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ inputNewGroupDesc(e, type) {$/;" function line:142
selectGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ selectGroup(e) {$/;" function line:151
searchGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ searchGroup(e, value) {$/;" function line:175
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ render () {$/;" function line:185
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/LoginWrap.js /^ constructor(props){$/;" function line:16
static.form /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/LoginWrap.js /^ static propTypes = {$/;" property line:20
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Login/LoginWrap.js /^ render() {$/;" function line:25
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ constructor(props) {$/;" function line:24
state.mockURL /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ this.state = {$/;" property line:26
static.uid /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ static propTypes = {$/;" property line:30
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ componentWillMount(){$/;" function line:34
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/News.js /^ render () {$/;" function line:44
@connect.fetchNewsData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ static propTypes = {$/;" property line:34
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ constructor(props) {$/;" function line:40
constructor.state.selectedKeys /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ this.state = {$/;" property line:42
getLogData /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ getLogData(e){$/;" function line:46
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/News/NewsList/NewsList.js /^ render () {$/;" function line:59
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/LeftMenu.js /^ constructor(props) {$/;" function line:21
@connect.state.dataSource /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/LeftMenu.js /^ this.state = {$/;" property line:23
static.curUid /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/LeftMenu.js /^ static propTypes = {$/;" property line:31
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/LeftMenu.js /^ render() {$/;" function line:68
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/List.js /^ constructor(props) {$/;" function line:24
@connect.state.data /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/List.js /^ this.state = {$/;" property line:26
static.curUserRole /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/List.js /^ static propTypes = {$/;" property line:32
getUserList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/List.js /^ getUserList() {$/;" function line:41
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/List.js /^ componentDidMount() {$/;" function line:60
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/User/List.js /^ render() {$/;" function line:85
from.children /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ static propTypes = {$/;" property line:8
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ constructor(props) {$/;" function line:15
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ componentWillMount() {$/;" function line:19
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ render () {$/;" function line:22

9
.tags1
View File

@ -4,8 +4,7 @@
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ constructor(props) {$/;" function line:26
state.login /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ this.state = {$/;" property line:28
static.checkLoginState /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ componentDidMount() {$/;" function line:38
render /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ render() {$/;" function line:71
from.children /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ static propTypes = {$/;" property line:8
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ constructor(props) {$/;" function line:15
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ componentWillMount() {$/;" function line:19
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ render () {$/;" function line:22

View File

@ -1,98 +1,17 @@
# YApi
## 平台介绍
## 一、平台介绍
<p style='text-indent:2em;line-height:1.8em'>YApi是<strong>高效</strong><strong>易用</strong><strong>功能强大</strong>、的api管理平台旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护、监控和保护任意规模的 API而且yapi为用户提供了优秀的交互体验开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的创建</p>
<p style='text-indent:2em;line-height:1.8em'>YApi是<strong>高效</strong><strong>易用</strong><strong>功能强大</strong>、的api管理平台旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护、监控和保护任意规模的 APIyapi为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理</p>
## 功能
1. 项目接口管理
提供基本的项目分组,项目管理,接口管理功能
2. mockServer服务
用户只需在项目配置线上域名和接口基本路径通过将线上域名指到我们的yapi平台服务器就可使用mockServer服务
3. 用户管理
提供基本的用户注册登录管理等功能集成了去哪儿QSSO登录
## 快速开始
### 1 接口管理架构
平台以**项目分组** -> **项目** -> **接口**的划分进行接口组织管理。
<img src="http://upload-images.jianshu.io/upload_images/842107-305ba49a60ee1ff5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
#### 1.1 项目分组
登录之后进到项目首页,左边侧边栏显示的即分组列表。
<img src="http://upload-images.jianshu.io/upload_images/842107-d90ca4b3242fa760.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "200" style="margin-left:170px;display:block;" alt="图片名称" align=center />
管理员有权限添加或删除分组。
<img src="http://upload-images.jianshu.io/upload_images/842107-a0d4d9a98003896a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "500" style="margin-left:170px;display:block;" alt="图片名称" align=center />
> 分组名称具有唯一性
#### 1.2 项目
选中不同的分组,右边会显示该分组下的项目列表。
<img src="http://upload-images.jianshu.io/upload_images/842107-137bcae58b84715e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
创建项目需要填写项目名称,项目线上域名(添加完成后可配置项目其他环境域名),项目接口基本路径(接口路径前面相同的部分)以及项目描述。
<img src="http://upload-images.jianshu.io/upload_images/842107-360a50ddb746f73d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
> 项目『线上域名 + 基本路径』具有唯一性
#### 1.3 接口
点击项目名称,进入该项目接口列表。
<img src="http://upload-images.jianshu.io/upload_images/842107-e858005f714f4889.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
点击编辑,进入接口详情页(之后接口详情页和编辑也会分开),可以编辑接口或者请求测试真实接口。
<img src="http://upload-images.jianshu.io/upload_images/842107-78c0ea839619d068.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
<img src="http://upload-images.jianshu.io/upload_images/842107-2ee7171d707e91ff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
## 二、特性
* 完善的项目接口管理功能
* 易用的MockServer
* 类gitlab的用户管理和权限管理功能
* 强大的接口集功能
### 2 Mock功能
<p style='text-indent:2em;line-height:1.8em'>yapi的Mock功能可以根据用户的输入接口信息如协议、URL、接口名、请求头、请求参数、mock规则生成Mock接口这些接口会自动生成模拟数据支持复杂的生成逻辑创建者可以自由构造需要的数据。而且与常见的Mock方式如将Mock写在代码里和JS拦截等相比yapi的Mock在使用场景和效率和复杂度上是相差甚远的正是由于yapi的Mock是一个第三方平台那么在 团队开发时任何人都可以权限许可下创建、修改接口信息等操作,这对于团队开发是很有好处的。</p>
#### 2.1 添加接口
通过点击页面上的"+添加接口"
<img src="http://note.youdao.com/yws/api/personal/file/WEB613bd4f29db038f2b41c03dcfceda2b6?method=download&shareKey=29bfc2b855f6f26ce0079baf567e54cc" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
输入协议、URL、接口名、请求头、请求参数、mock规则等信息然后点击右上角的"Mock"按钮。
<img src="http://upload-images.jianshu.io/upload_images/842107-78c0ea839619d068.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
#### 2.2 Mock
当点击"Mock"按钮之后就会在页面下方生成一个mock结果并产生一个API接口。点击"复制"按钮即可复制,用户拿到接口后就可以发请求了。
<img src="http://note.youdao.com/yws/api/personal/file/WEBf9b154cb88d21daa8206e8c4a3d76042?method=download&shareKey=1999f6c2cf197b5b6d775c312e34073d" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
将请求的信息填写完善如请求方法post、get等、URL、请求头、请求的数据等。然后就点击"发送",然后在"返回结果"出可以看到接口返回的数据。
<img src="http://upload-images.jianshu.io/upload_images/842107-2ee7171d707e91ff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
#### 2.3 成员管理
你也可以通过点击"管理成员"来添加和删除项目的成员,便于团队管理。
<img src="http://note.youdao.com/yws/api/personal/file/WEB1b9defdf0cb884f46c2bd6c30ceb02fb?method=download&shareKey=218b9326659208ec564b9fff3ea8c6c3" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
## 未来计划推出功能
1. 可视化JSON编辑器可定义JSON_Schema和mockjs
2. 支持HTTP和RPC协议
3. 自动化测试
4. 多人协作

View File

@ -7,7 +7,7 @@ import User from './containers/User/User.js';
import Header from './components/Header/Header';
import Footer from './components/Footer/Footer';
import Loading from './components/Loading/Loading';
import { checkLoginState } from './reducer/modules/login';
import { checkLoginState } from './reducer/modules/user';
import { requireAuthentication } from './components/AuthenticatedComponent';
const LOADING_STATUS = 0;
@ -15,7 +15,7 @@ const LOADING_STATUS = 0;
@connect(
state => {
return {
loginState: state.login.loginState
loginState: state.user.loginState
};
},
{
@ -35,6 +35,13 @@ export default class App extends Component {
loginState: PropTypes.number
};
// componentWillMount() {
// if( !this.props.isAuthenticated ){
// this.props.history.push('/');
// this.props.changeMenuItem('/');
// }
// }
componentDidMount() {
this.props.checkLoginState();
}

View File

@ -6,7 +6,7 @@ import { changeMenuItem } from '../reducer/modules/menu'
@connect(
(state) => {
return{
isAuthenticated: state.login.isLogin
isAuthenticated: state.user.isLogin
}
},
{

View File

@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { Icon, Layout, Menu, Dropdown, message, Tooltip } from 'antd'
import { checkLoginState, logoutActions, loginTypeAction} from '../../reducer/modules/login'
import { checkLoginState, logoutActions, loginTypeAction} from '../../reducer/modules/user'
import { changeMenuItem } from '../../reducer/modules/menu'
import { withRouter } from 'react-router';
import Srch from './Search/Search'
@ -89,10 +89,10 @@ ToolUser.propTypes={
@connect(
(state) => {
return{
user: state.login.userName,
uid: state.login.uid,
user: state.user.userName,
uid: state.user.uid,
msg: null,
login:state.login.isLogin
login:state.user.isLogin
}
},
{

View File

@ -0,0 +1,19 @@
import Breadcrumb from './Breadcrumb/Breadcrumb.js'
import Footer from './Footer/Footer.js'
import Header from './Header/Header.js'
import Intro from './Intro/Intro.js'
import Loading from './Loading/Loading.js'
import MockDoc from './MockDoc/MockDoc.js'
import ProjectBox from './ProjectBox/ProjectBox.js'
import Subnav from './Subnav/Subnav.js'
export {
Breadcrumb,
Footer,
Header,
Intro,
Loading,
MockDoc,
ProjectBox,
Subnav
}

View File

@ -38,7 +38,7 @@ const success = (text, arg) => {
url: state.addInterface.url,
seqGroup: state.addInterface.seqGroup,
interfaceName: state.addInterface.interfaceName,
server_ip: state.login.server_ip,
server_ip: state.user.server_ip,
clipboard: state.addInterface.clipboard
}
},

View File

@ -21,7 +21,7 @@ import './GroupList.scss'
state => ({
groupList: state.group.groupList,
currGroup: state.group.currGroup,
curUserRole: state.login.role
curUserRole: state.user.role
}),
{
fetchGroupList,

View File

@ -127,7 +127,7 @@ HomeGuest.propTypes ={
@connect(
state => ({
login: state.login.isLogin
login: state.user.isLogin
}),
{
changeMenuItem

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Form, Button, Input, Icon, message } from 'antd';
import { loginActions } from '../../reducer/modules/login';
import { loginActions } from '../../reducer/modules/user';
const FormItem = Form.Item;
import './Login.scss'
@ -17,7 +17,7 @@ const changeHeight = {
@connect(
state => {
return {
loginData: state.login
loginData: state.user
}
},
{

View File

@ -9,7 +9,7 @@ const TabPane = Tabs.TabPane;
@connect(
state =>({
loginWrapActiveKey: state.login.loginWrapActiveKey
loginWrapActiveKey: state.user.loginWrapActiveKey
})
)
export default class LoginWrap extends Component {

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Form, Button, Input, Icon, message } from 'antd';
import { regActions } from '../../reducer/modules/login';
import { regActions } from '../../reducer/modules/user';
const FormItem = Form.Item;
const formItemStyle = {
@ -16,7 +16,7 @@ const changeHeight = {
@connect(
state => {
return {
loginData: state.login
loginData: state.user
}
},
{

View File

@ -12,7 +12,7 @@ import Subnav from '../../components/Subnav/Subnav.js';
state => {
console.log(state);
return {
uid: state.login.uid + ''
uid: state.user.uid + ''
}
},
{

View File

@ -20,7 +20,7 @@ const logList = [{
state => {
// console.log(state);
return {
uid: state.login.uid + "",
uid: state.user.uid + "",
newsData: state.news.newsData
}
},

View File

@ -1,5 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Route, Switch, Redirect } from 'react-router-dom';
import { Subnav } from '../../components/index'
export default class GroupList extends Component {
@ -20,8 +22,24 @@ export default class GroupList extends Component {
render () {
return (
<div>
我是项目页喔
{this.props.children}
<Subnav
default={'接口'}
data={[{
name: '接口',
path: '/project/:id/activity'
}, {
name: '设置',
path: '/project/:id/setting'
}, {
name: '动态',
path: '/project/:id/activity'
}]}/>
<Switch>
<Redirect exact from='/project/:id' to='/project/:id/interface' />
<Route path="/project/:id/activity" component={null} />
<Route path="/project/:id/interface" component={null} />
<Route path="/project/:id/setting" component={null} />
</Switch>
</div>
)
}

View File

@ -11,9 +11,9 @@ const Option = AutoComplete.Option;
state => {
console.log(state);
return {
curUid: state.login.uid + '',
curUserName: state.login.userName,
curUserRole: state.login.role
curUid: state.user.uid + '',
curUserName: state.user.userName,
curUserRole: state.user.role
}
}
)

View File

@ -15,7 +15,7 @@ const limit = 10;
@connect(
state => {
return {
curUserRole: state.login.role
curUserRole: state.user.role
}
}
)
@ -41,7 +41,7 @@ class List extends Component {
getUserList() {
axios.get('/user/list?page=' + this.state.current).then((res) => {
let result = res.data;
if (result.errcode === 0) {
let list = result.data.list;
let total = result.data.total * limit;
@ -118,7 +118,7 @@ class List extends Component {
width:80,
render: (item) => {
return (
<span>
<span>
<Link to={"/user/profile/" + item._id} >查看</Link>
<span className="ant-divider" />
<Popconfirm title="确认删除此用户?" onConfirm={() => {this.confirm(item._id)}} okText="确定" cancelText="取消">

View File

@ -17,7 +17,8 @@ const initialState = {
userInfo: {},
tableLoading: true,
total: 0,
currPage: 1
currPage: 1,
curProject: {}
};
export default (state = initialState, action) => {

View File

@ -1,5 +1,5 @@
import { combineReducers } from 'redux';
import login from './login.js'
import user from './user.js'
import group from './group.js'
import project from './project.js'
import Interface from './interface.js'
@ -9,7 +9,7 @@ import menu from './menu.js'
export default combineReducers({
group,
login,
user,
Interface,
project,
news,

View File

@ -1,21 +1,22 @@
import axios from 'axios';
// Actions
const LOGIN = 'yapi/login/LOGIN';
const LOGIN_OUT = 'yapi/login/LOGIN_OUT';
const LOGIN_TYPE = 'yapi/login/LOGIN_TYPE';
const GET_LOGIN_STATE = 'yapi/login/GET_LOGIN_STATE';
const REGISTER = 'yapi/login/REGISTER';
const LOGIN = 'yapi/user/LOGIN';
const LOGIN_OUT = 'yapi/user/LOGIN_OUT';
const LOGIN_TYPE = 'yapi/user/LOGIN_TYPE';
const GET_LOGIN_STATE = 'yapi/user/GET_LOGIN_STATE';
const REGISTER = 'yapi/user/REGISTER';
// Reducer
const LOADING_STATUS = 0;
const GUEST_STATUS = 1;
const MEMBER_STATUS = 2;
// Reducer user
const initialState = {
isLogin: false,
userName: null,
uid: null,
email: '',
loginState: LOADING_STATUS,
loginWrapActiveKey: "1"
};

View File

@ -19,6 +19,7 @@ class baseController {
async init(ctx) {
this.$user = null;
console.log(111111)
let ignoreRouter = [
'/user/login_by_token',
'/user/login',
@ -26,7 +27,7 @@ class baseController {
'/user/status',
'/user/logout'
];
if (ignoreRouter.indexOf(ctx.path) > -1) {
if (ignoreRouter.indexOf(ctx.path) > -1) {
this.$auth = true;
} else {
await this.checkLogin(ctx);
@ -61,10 +62,14 @@ class baseController {
}
}
/**
*
* @param {*} ctx
*/
async getLoginStatus(ctx) {
if (await this.checkLogin(ctx) === true) {
let result = yapi.commons.fieldSelect(this.$user, ['_id', 'username', 'email', 'up_time', 'add_time', 'role']);
let result = yapi.commons.fieldSelect(this.$user, ['_id', 'username', 'email', 'up_time', 'add_time', 'role', 'type']);
result.server_ip = yapi.WEBCONFIG.server_ip;
return ctx.body = yapi.commons.resReturn(result);
}

View File

@ -54,8 +54,8 @@ class userController extends baseController {
email: result.email,
add_time: result.add_time,
up_time: result.up_time,
server_ip: yapi.WEBCONFIG.server_ip
server_ip: yapi.WEBCONFIG.server_ip,
type: 'site'
}, 0, 'logout success...');
} else {
return ctx.body = yapi.commons.resReturn(null, 405, '密码错误');
@ -555,26 +555,24 @@ class userController extends baseController {
}
/**
* 根据路由id获取面包屑数据
* @interface /user/nav
* 根据路由id初始化项目数据
* @interface /user/project
* @method GET
* @category user
* @foldnumber 10
* @param {String} type 可选group|interface|project
* @param {Number} id
* @return {Object}
* @example ./api/user/nav.json
* @example
*/
async nav(ctx) {
async project(ctx) {
let { id, type } = ctx.request.query;
let result = {};
try {
if (type === 'interface') {
let interfaceInst = yapi.getInst(interfaceModel);
let interfaceData = await interfaceInst.get(id)
result["interface_id"] = interfaceData._id;
result["interface_name"] = interfaceData.path;
result.interface = interfaceData;
type = 'project';
id = interfaceData.project_id;
}
@ -582,17 +580,38 @@ class userController extends baseController {
if (type === 'project') {
let projectInst = yapi.getInst(projectModel);
let projectData = await projectInst.get(id);
result["project_id"] = projectData._id;
result["project_name"] = projectData.prd_host + projectData.basepath;
result.project = projectData.toObject();
let ownerAuth = await this.checkAuth(id, 'project', 'danger'), devAuth;
if(ownerAuth){
result.project.role = 'owner'
}else{
devAuth = await this.checkAuth(id, 'project', 'site');
if(devAuth){
result.project.role = 'dev'
}else{
result.project.role = 'member'
}
}
type = 'group';
id = projectData.group_id
id = projectData.group_id;
}
if (type === 'group') {
let groupInst = yapi.getInst(groupModel);
let groupData = await groupInst.get(id);
result["group_id"] = groupData._id;
result["group_name"] = groupData.group_name;
result.group = groupData.toObject();
let ownerAuth = await this.checkAuth(id, 'group', 'danger'), devAuth;
if(ownerAuth){
result.group.role = 'owner'
}else{
devAuth = await this.checkAuth(id, 'group', 'site');
if(devAuth){
result.group.role = 'dev'
}else{
result.group.role = 'member'
}
}
}
return ctx.body = yapi.commons.resReturn(result)

View File

@ -1,17 +0,0 @@
// const jwt = require('jsonwebtoken');
//检查token是否过期
module.exports = async ( ctx, next ) => {
// const authorization = ctx.get('Authorization');
// if (authorization === '') {
// ctx.throw(401, 'no token detected in http header ');
// }
// const token = authorization.split(' ')[1];
// let tokenContent;
// try {
// tokenContent = await jwt.verify(token, 'qunar'); //如果token过期或验证失败将抛出错误
// } catch (err) {
// ctx.throw(401, 'invalid token');
// }
await next();
};

View File

@ -1,6 +0,0 @@
module.exports = async (ctx, next) => {
let path = ctx.path;
console.log(path); // eslint-disable-line
console.log(ctx.hostname); // eslint-disable-line
if (next) await next();
};

View File

@ -145,8 +145,8 @@ const routerConfig = {
"method": "get"
},
{
"action": "nav",
"path": "nav",
"action": "project",
"path": "project",
"method": "get"
},{
"action": "avatar",

View File

@ -66,22 +66,23 @@ var baseController = function () {
switch (_context.prev = _context.next) {
case 0:
this.$user = null;
console.log(111111);
ignoreRouter = ['/user/login_by_token', '/user/login', '/user/reg', '/user/status', '/user/logout'];
if (!(ignoreRouter.indexOf(ctx.path) > -1)) {
_context.next = 6;
_context.next = 7;
break;
}
this.$auth = true;
_context.next = 8;
_context.next = 9;
break;
case 6:
_context.next = 8;
case 7:
_context.next = 9;
return this.checkLogin(ctx);
case 8:
case 9:
case 'end':
return _context.stop();
}
@ -162,6 +163,11 @@ var baseController = function () {
return checkLogin;
}()
/**
*
* @param {*} ctx
*/
}, {
key: 'getLoginStatus',
value: function () {
@ -182,7 +188,7 @@ var baseController = function () {
break;
}
result = _yapi2.default.commons.fieldSelect(this.$user, ['_id', 'username', 'email', 'up_time', 'add_time', 'role']);
result = _yapi2.default.commons.fieldSelect(this.$user, ['_id', 'username', 'email', 'up_time', 'add_time', 'role', 'type']);
result.server_ip = _yapi2.default.WEBCONFIG.server_ip;
return _context3.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(result));

View File

@ -155,8 +155,8 @@ var userController = function (_baseController) {
email: result.email,
add_time: result.add_time,
up_time: result.up_time,
server_ip: _yapi2.default.WEBCONFIG.server_ip
server_ip: _yapi2.default.WEBCONFIG.server_ip,
type: 'site'
}, 0, 'logout success...'));
case 19:
@ -1157,22 +1157,22 @@ var userController = function (_baseController) {
}()
/**
* 根据路由id获取面包屑数据
* @interface /user/nav
* 根据路由id初始化项目数据
* @interface /user/project
* @method GET
* @category user
* @foldnumber 10
* @param {String} type 可选group|interface|project
* @param {Number} id
* @return {Object}
* @example ./api/user/nav.json
* @example
*/
}, {
key: 'nav',
key: 'project',
value: function () {
var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(ctx) {
var _ctx$request$query, id, type, result, interfaceInst, interfaceData, projectInst, projectData, groupInst, groupData;
var _ctx$request$query, id, type, result, interfaceInst, interfaceData, projectInst, projectData, ownerAuth, devAuth, groupInst, groupData, _ownerAuth, _devAuth;
return _regenerator2.default.wrap(function _callee14$(_context14) {
while (1) {
@ -1183,7 +1183,7 @@ var userController = function (_baseController) {
_context14.prev = 2;
if (!(type === 'interface')) {
_context14.next = 12;
_context14.next = 11;
break;
}
@ -1194,67 +1194,121 @@ var userController = function (_baseController) {
case 7:
interfaceData = _context14.sent;
result["interface_id"] = interfaceData._id;
result["interface_name"] = interfaceData.path;
result.interface = interfaceData;
type = 'project';
id = interfaceData.project_id;
case 12:
case 11:
if (!(type === 'project')) {
_context14.next = 21;
_context14.next = 31;
break;
}
projectInst = _yapi2.default.getInst(_project2.default);
_context14.next = 16;
_context14.next = 15;
return projectInst.get(id);
case 16:
case 15:
projectData = _context14.sent;
result["project_id"] = projectData._id;
result["project_name"] = projectData.prd_host + projectData.basepath;
result.project = projectData.toObject();
_context14.next = 19;
return this.checkAuth(id, 'project', 'danger');
case 19:
ownerAuth = _context14.sent;
devAuth = void 0;
if (!ownerAuth) {
_context14.next = 25;
break;
}
result.project.role = 'owner';
_context14.next = 29;
break;
case 25:
_context14.next = 27;
return this.checkAuth(id, 'project', 'site');
case 27:
devAuth = _context14.sent;
if (devAuth) {
result.project.role = 'dev';
} else {
result.project.role = 'member';
}
case 29:
type = 'group';
id = projectData.group_id;
case 21:
case 31:
if (!(type === 'group')) {
_context14.next = 28;
_context14.next = 49;
break;
}
groupInst = _yapi2.default.getInst(_group2.default);
_context14.next = 25;
_context14.next = 35;
return groupInst.get(id);
case 25:
case 35:
groupData = _context14.sent;
result["group_id"] = groupData._id;
result["group_name"] = groupData.group_name;
result.group = groupData.toObject();
_context14.next = 39;
return this.checkAuth(id, 'group', 'danger');
case 28:
case 39:
_ownerAuth = _context14.sent;
_devAuth = void 0;
if (!_ownerAuth) {
_context14.next = 45;
break;
}
result.group.role = 'owner';
_context14.next = 49;
break;
case 45:
_context14.next = 47;
return this.checkAuth(id, 'group', 'site');
case 47:
_devAuth = _context14.sent;
if (_devAuth) {
result.group.role = 'dev';
} else {
result.group.role = 'member';
}
case 49:
return _context14.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(result));
case 31:
_context14.prev = 31;
case 52:
_context14.prev = 52;
_context14.t0 = _context14['catch'](2);
return _context14.abrupt('return', ctx.body = _yapi2.default.commons.resReturn(result, 422, _context14.t0.message));
case 34:
case 55:
case 'end':
return _context14.stop();
}
}
}, _callee14, this, [[2, 31]]);
}, _callee14, this, [[2, 52]]);
}));
function nav(_x15) {
function project(_x15) {
return _ref14.apply(this, arguments);
}
return nav;
return project;
}()
}]);
return userController;

View File

@ -162,8 +162,8 @@ var routerConfig = {
"path": "search",
"method": "get"
}, {
"action": "nav",
"path": "nav",
"action": "project",
"path": "project",
"method": "get"
}, {
"action": "avatar",

95
ykit.js
View File

@ -6,6 +6,67 @@ var assetsPluginInstance = new AssetsPlugin({
return 'window.WEBPACK_ASSETS = ' + JSON.stringify(assets);
}
})
function handleCommonsChunk(webpackConfig) {
var commonsChunk = {
//filename: 'scripts/[name]@[chunkhash][ext]',
vendors: {
lib: ['react', 'redux',
'redux-thunk',
'react-dom',
'redux-promise',
'react-router-dom',
'prop-types'
],
lib2: [
'axios',
'moment'
]
}
},
chunks = [],
filenameTpl = webpackConfig.output[this.env],
vendors;
if (typeof commonsChunk === 'object' && commonsChunk !== undefined) {
if (typeof commonsChunk.name === 'string' && commonsChunk) {
chunks.push(commonsChunk.name);
}
vendors = commonsChunk.vendors;
if (typeof vendors === 'object' && vendors !== undefined) {
var i = 0;
for (var name in vendors) {
if (vendors.hasOwnProperty(name) && vendors[name]) {
i++;
chunks.push(name);
webpackConfig.entry[name] = Array.isArray(vendors[name]) ? vendors[name] : [vendors[name]];
}
}
if (i > 0) {
chunks.push('manifest');
}
}
if (chunks.length > 0) {
let chunkFilename = filenameTpl.filename
chunkFilename = chunkFilename.replace("[ext]", '.js')
webpackConfig.plugins.push(
new this.webpack.optimize.CommonsChunkPlugin({
name: chunks,
filename: chunkFilename,
minChunks: commonsChunk.minChunks ? commonsChunk.minChunks : 2
})
);
}
}
}
module.exports = {
plugins: [{
name: 'antd',
@ -28,45 +89,35 @@ module.exports = {
exports: [
'./index.js'
],
commonsChunk: {
//filename: 'scripts/[name]@[chunkhash][ext]',
vendors: {
lib: ['react', 'redux',
'redux-thunk',
'react-dom',
'redux-promise',
'react-router-dom',
'prop-types'
],
lib2:[
'axios',
'moment'
]
}
},
modifyWebpackConfig: function (baseConfig) {
var ENV_PARAMS = {};
switch (this.env) {
case 'local':
ENV_PARAMS = {development: true};
ENV_PARAMS = { development: true };
break;
case 'dev':
ENV_PARAMS = {development: true};
ENV_PARAMS = { development: true };
break;
case 'prd':
ENV_PARAMS = {development: false};
ENV_PARAMS = { development: false };
break;
default:
}
}
baseConfig.plugins.push(new this.webpack.DefinePlugin({
ENV_PARAMS: JSON.stringify(ENV_PARAMS)
ENV_PARAMS: JSON.stringify(ENV_PARAMS)
}))
//初始化配置
baseConfig.devtool = 'cheap-module-eval-source-map'
baseConfig.context = path.resolve(__dirname, "client");
baseConfig.output.prd.path = 'static/prd';
baseConfig.output.prd.publicPath = '';
baseConfig.output.prd.filename = '[name]@[chunkhash][ext]'
//commonsChunk
handleCommonsChunk.call(this, baseConfig)
baseConfig.module.loaders.push({
test: /\.(sass|scss)$/,
loader: ykit.ExtractTextPlugin.extract(