feat: merge to local and fix some bug

This commit is contained in:
suxiaoxin 2017-08-11 10:31:26 +08:00
commit 6360e6722d
25 changed files with 336 additions and 204 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

@ -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

@ -11,7 +11,7 @@ class Footer extends Component {
}
render () {
const style = {
'background': 'url(./image/footer-bac.jpg)'
'background': 'url(/image/footer-bac.jpg)'
}
return (
<div className = 'footer-wrapper'>

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'
@ -53,7 +53,7 @@ const ToolUser = (props)=> (
</Link>
<Tooltip placement="bottom" title={'使用文档'}>
<li className="toolbar-li">
<a target="_blank" href="./doc/index.html"><Icon className="dropdown-link" style={{ fontSize: 16 }} type="question-circle" /></a>
<a target="_blank" href="/doc/index.html"><Icon className="dropdown-link" style={{ fontSize: 16 }} type="question-circle" /></a>
</li>
</Tooltip>
<li className="toolbar-li">
@ -69,7 +69,9 @@ const ToolUser = (props)=> (
/>
}>
<a className="dropdown-link">
<img style={{width:30,height:30}} src="/api/user/avatar" /><span className="name">{props.user}</span>
<img style={{width:24,height:24}} src={`/api/user/avatar?uid=${props.uid}`} /><span className="name">{props.user}</span>
</a>
</Dropdown>
</li>
@ -89,10 +91,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
}
},
{
@ -163,6 +165,9 @@ export default class HeaderCom extends Component {
console.log(err);
})
}
render () {
const { login, user, msg, uid } = this.props;
return (
@ -170,7 +175,7 @@ export default class HeaderCom extends Component {
<div className="content g-row">
<div className="logo">
<Link to="/" onClick={this.relieveLink} className="href">
<img className="img" src="./image/logo_header@1x.png" /><span className="logo-name">YAPI<span className="ui-badge"></span></span>
<img className="img" src="/image/logo_header@1x.png" /><span className="logo-name">YAPI<span className="ui-badge"></span></span>
</Link>
</div>
<div className="user-toolbar">

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

@ -1,56 +0,0 @@
import './index.scss'
import React, { Component } from 'react'
// import PropTypes from 'prop-types'
import { Upload, Icon, message } from 'antd'
class Avatar extends Component {
constructor(props) {
super(props);
this.state = {
imageUrl:""
}
}
handleChange(info){
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
}
}
render() {
const imageUrl = this.state.imageUrl;
return <div className="avatar-box">
<Upload
className="avatar-uploader"
name="avatar"
showUploadList={true}
action="//jsonplaceholder.typicode.com/posts/"
beforeUpload={beforeUpload}
onChange={this.handleChange.bind(this)} >
{
imageUrl ?
<img src={imageUrl} alt="" className="avatar" /> :
<Icon type="plus" className="avatar-uploader-trigger" />
}
</Upload>
</div>
}
}
function beforeUpload(file) {
const isJPG = file.type === 'image/jpeg';
if (!isJPG) {
message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('Image must smaller than 2MB!');
}
return isJPG && isLt2M;
}
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default Avatar;

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('/api/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

@ -1,10 +1,9 @@
import React, { Component } from 'react'
import { Row, Col, Input, Button, Select, message } from 'antd'
import { Row, Col, Input, Button, Select, message, Upload, Icon } from 'antd'
import axios from 'axios';
import {formatTime} from '../../common.js'
import PropTypes from 'prop-types'
class Profile extends Component {
static propTypes = {
@ -191,6 +190,7 @@ class Profile extends Component {
return <div className="user-profile">
<Row className="user-item" type="flex" justify="start">
<Col span={24}><Avatar uid={userinfo.uid}>点击上传头像</Avatar></Col>
<Col span={4}>用户id</Col>
<Col span={12}>
{userinfo.uid}
@ -237,4 +237,76 @@ class Profile extends Component {
}
}
class Avatar extends Component {
constructor(props) {
super(props);
this.state = {
imageUrl:""
}
}
static propTypes = {
uid: PropTypes.number
}
uploadAvatar(basecode){
axios.post("/user/upload_avatar",{basecode: basecode}).then(()=>{
this.setState({ imageUrl: basecode })
}).catch((e)=>{
console.log(e);
})
}
handleChange(info){
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, basecode=>{this.uploadAvatar(basecode)});
}
}
render() {
let imageUrl = "";
if(this.props.uid && !this.state.imageUrl){
imageUrl = `/user/avatar?uid=${this.props.uid}`;
}else{
imageUrl = this.state.imageUrl;
}
return <div className="avatar-box">
<Upload
className="avatar-uploader"
name="basecode"
showUploadList={true}
action="/user/upload_avatar"
beforeUpload={beforeUpload}
onChange={this.handleChange.bind(this)} >
{
imageUrl ?
<img src={imageUrl} alt="" className="avatar" /> :
<Icon type="plus" className="avatar-uploader-trigger" />
}
</Upload>
</div>
}
}
function beforeUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isPNG = file.type === 'image/png';
if (!isJPG && !isPNG) {
message.error('图片的格式只能为 jpg、png');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('图片必须小于 200kb!');
}
return (isPNG||isJPG) && isLt2M;
}
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default Profile

View File

@ -2,12 +2,12 @@ import './index.scss'
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Route } from 'react-router-dom'
import LeftMenu from './LeftMenu.js'
// import LeftMenu from './LeftMenu.js'
import List from './List.js'
import PropTypes from 'prop-types'
import Profile from './Profile.js'
import { Row, Col } from 'antd';
import { Row } from 'antd';
import Subnav from '../../components/Subnav/Subnav.js';
@connect()
class User extends Component {
static propTypes = {
@ -26,16 +26,22 @@ class User extends Component {
return (
<div className="g-doc">
<Row gutter={16} className="user-box">
<Col span={6}>
<LeftMenu />
</Col>
<Col span={18}>
<div>
<Subnav
default={'我的关注'}
data={[{
name: '项目广场',
path: '/group'
}, {
name: '我的关注',
path: '/follow'
}]}/>
<div className="g-doc">
<Row gutter={16} className="user-box">
<Route path={this.props.match.path + '/list'} component={List} />
<Route path={this.props.match.path + '/profile/:uid'} component={Profile} />
</Col>
</Row>
</Row>
</div>
</div>
)
}

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

@ -490,11 +490,19 @@ class userController extends baseController {
}
/**
* 根据用户uid头像
* @interface /user/avatar
* @method GET
* @param {*} uid
*/
async avatar(ctx) {
try{
let uid = ctx.query.uid ? ctx.query.uid: this.getUid();
let avatarInst = yapi.getInst(avatarModel);
let data = await avatarInst.get(this.getUid());
let data = await avatarInst.get(uid);
let dataBuffer, type;
if(!data || !data.basecode){
dataBuffer = yapi.fs.readFileSync(yapi.path.join(yapi.WEBROOT, 'static/image/avatar.png'));

View File

@ -1035,21 +1035,30 @@ var userController = function (_baseController) {
return uploadAvatar;
}()
/**
* 根据用户uid头像
* @interface /user/avatar
* @method GET
* @param {*} uid
*/
}, {
key: 'avatar',
value: function () {
var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(ctx) {
var avatarInst, data, dataBuffer, type;
var uid, avatarInst, data, dataBuffer, type;
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
switch (_context12.prev = _context12.next) {
case 0:
_context12.prev = 0;
uid = ctx.query.uid ? ctx.query.uid : this.getUid();
avatarInst = _yapi2.default.getInst(_avatar2.default);
_context12.next = 4;
return avatarInst.get(this.getUid());
_context12.next = 5;
return avatarInst.get(uid);
case 4:
case 5:
data = _context12.sent;
dataBuffer = void 0, type = void 0;
@ -1063,21 +1072,21 @@ var userController = function (_baseController) {
ctx.set('Content-type', type);
ctx.body = dataBuffer;
_context12.next = 14;
_context12.next = 15;
break;
case 11:
_context12.prev = 11;
case 12:
_context12.prev = 12;
_context12.t0 = _context12['catch'](0);
ctx.body = 'error:' + _context12.t0.message;
case 14:
case 15:
case 'end':
return _context12.stop();
}
}
}, _callee12, this, [[0, 11]]);
}, _callee12, this, [[0, 12]]);
}));
function avatar(_x13) {