Explorar o código

增加退出登录

dev01 hai 1 ano
pai
achega
95a044545a
Modificáronse 3 ficheiros con 29 adicións e 4 borrados
  1. 17 1
      js/component/manageCenter/top.jsx
  2. 11 2
      js/component/manageCenter/top.less
  3. 1 1
      package.json

+ 17 - 1
js/component/manageCenter/top.jsx

@@ -1,14 +1,30 @@
 import React from 'react';
+import $ from "jquery/src/ajax";
 import './top.less';
 import logo from '../../../image/kede.png';
 
 const Bottom = React.createClass({
+
+  logOut() {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      url: globalConfig.context + "/login",
+    }).done(function (data) {
+      window.location.href = globalConfig.context + "/RD/admin/login";
+    });
+  },
+
   render() {
     return (
       <div className="top">
         <img className="top-logo" src={logo} alt="" />
         科研中心RD库
-        <a href={globalConfig.context + "/admin/login"}>前往科德系统</a>
+        <div className='top-rignt'>
+          <span>{adminData.name || adminData.mobile}</span>
+          <a onClick={this.logOut} style={{ color: "#fff", marginRight: "30px" }}>[ 退出 ]</a>
+          <a href={globalConfig.context + "/admin/login"}>前往科德系统</a>
+        </div>
       </div>
     );
   }

+ 11 - 2
js/component/manageCenter/top.less

@@ -20,10 +20,19 @@
 
   }
 
-  a {
-    font-size: 16px;
+  .top-rignt {
     position: absolute;
     right: 40px;
+
+    span {
+      font-size: 16px;
+    }
+
+    a {
+      font-size: 16px;
+      margin-left: 10px;
+    }
+
   }
 
 }

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.01",
+  "version": "1.0.02",
   "description": "",
   "main": "index.js",
   "scripts": {