top.jsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from 'react';
  2. import './portal.less';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. const LoginTop = React.createClass({
  6. logOut() {
  7. $.ajax({
  8. method: "get",
  9. dataType: "json",
  10. url: globalConfig.context + "/login",
  11. }).done(function (data) {
  12. window.location.href = globalConfig.context + "/user/login.html"
  13. });
  14. },
  15. render() {
  16. return (
  17. <div className="portal-header">
  18. <div className="portal-top clearfix">
  19. <div className="top-welcomeText">欢迎您来到科技认知计算交易平台!</div>
  20. <div className="top-alink">
  21. <a href={globalConfig.context + "/user/account/index.html"}>返回首页</a>
  22. {window.userData.number ?
  23. <span>
  24. <a href={globalConfig.context + "/user/account/index"}>尊敬的{userData.nickname || userData.number}</a>
  25. <a href="./index.html">交易管理中心</a>
  26. <a href="./index.html">消息</a>
  27. </span>
  28. : <a href={globalConfig.context + "/user/login/index"}>请登录</a>}
  29. <a onClick={this.logOut}>退出</a>
  30. <a href="./index.html">帮助中心</a>
  31. </div>
  32. </div>
  33. </div>
  34. )
  35. }
  36. });
  37. export default LoginTop;