import React from 'react'; import { Row, Col } from 'antd'; import './topTab.less'; import ajax from 'jquery/src/ajax/xhr.js' import $ from 'jquery/src/ajax'; import logo from '../../../image/acc-logo.png'; const TopTab = React.createClass({ getInitialState() { return { username: 'username', }; }, logOut() { $.ajax({ method: "get", dataType: "json", url: globalConfig.context + "/login", }).done(function (data) { window.location.href = globalConfig.context + "/portal/index.html" }); }, componentWillMount () { this.getData(); }, getData () { this.setState({ loading: false }); $.ajax({ method: "get", dataType: "json", url: globalConfig.context + "/api/user/nickname" }).done(function (data) { if (data.error && data.error.length) { message.warning(data.error[0].message); } else { this.setState({ nickname: data.data, }) } }.bind(this)).always(function () { this.setState({ loading: false }); }.bind(this)); }, render() { return (
欢迎您, {this.state.nickname || userData.nickname || userData.number } [ 退出 ] 返回首页
会员中心首页
账号设置 科技服务 科技成果 科技需求
) } }); export default TopTab;