top.jsx 1.6 KB

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