shaogen1995 2 năm trước cách đây
mục cha
commit
2c8436ba18

+ 1 - 1
src/pages/Home/index.tsx

@@ -206,7 +206,7 @@ export default function Home() {
         <div className="title">
           <div className="titleL">
             <h3>
-              欢迎 {userInfo.userName} 进入
+              欢迎 {userInfo.realName} 进入
               <br />
               乐山大佛博物馆
               <br />

+ 0 - 2
src/pages/Layout/index.tsx

@@ -1,6 +1,5 @@
 import {
   getTokenInfo,
-  removePowerInfo,
   removeTokenInfo,
 } from "@/utils/storage";
 import styles from "./index.module.scss";
@@ -159,7 +158,6 @@ function Layout() {
   // 点击退出登录
   const loginExit = () => {
     removeTokenInfo();
-    removePowerInfo();
     history.push("/login");
   };
 

+ 0 - 1
src/pages/ObjectSon/Object2/LookObject2/table.tsx

@@ -84,7 +84,6 @@ function LookObject2Log({ id }: Props) {
             )
               falg = true;
           });
-          // 暂时不处理权限问题,后面在完善
           return falg ? (
             <AuthButton
               id={-1}

+ 8 - 0
src/pages/SystemSon/System2/index.tsx

@@ -437,6 +437,14 @@ function System2() {
                   ))}
                 </div>
               ))}
+              {roleInfo.id === 1 ? (
+                <div className="powerBoxRow">
+                  <span className="label">系统管理:</span>
+                  <Checkbox className="oneCheck" defaultChecked={true}>
+                    启用
+                  </Checkbox>
+                </div>
+              ) : null}
             </div>
           </div>
 

+ 11 - 9
src/utils/http.ts

@@ -5,16 +5,18 @@ import { message } from "antd";
 // 请求基地址
 export const baseURL =
   // 线下的图片地址需要加上/api/
-  process.env.NODE_ENV === "development"
-    ? "http://192.168.20.55:8038/api/"
-    : "";
-// process.env.NODE_ENV === "development" ? "http://192.168.20.55:8038" : "";
+  // process.env.NODE_ENV === "development"
+  // ? "http://192.168.20.55:8038/api/"
+  // : "";
+process.env.NODE_ENV === "development" ? "https://lsbwg.4dage.com" : "";
 
 // 创建 axios 实例
 const http = axios.create({
-  // 线下的地址不用加/api/
-  baseURL: baseURL,
-  // baseURL: baseURL + "/api/",
+  // --------线下的地址不用加/api/
+  // baseURL: baseURL,
+
+  // --------打包或线上环境接口需要加上api/
+  baseURL: baseURL + "/api/",
   timeout: 5000,
 });
 
@@ -45,8 +47,8 @@ http.interceptors.response.use(
     axajInd--;
     if (axajInd === 0) {
       // setTimeout(() => {
-        lodingDom.style.opacity = 0;
-        lodingDom.style.pointerEvents = "none";
+      lodingDom.style.opacity = 0;
+      lodingDom.style.pointerEvents = "none";
       // }, 100);
     }
 

+ 0 - 34
src/utils/storage.ts

@@ -1,8 +1,5 @@
 // ------------------------------------token的本地存储------------------------------------
 
-import { message } from "antd";
-import history from "./history";
-
 // 用户信息的本地缓存键名(包括token)
 const USER_KEY = "LSDFGC_USER_INFO";
 
@@ -34,34 +31,3 @@ export const removeTokenInfo = (): void => {
 export const hasToken = (): boolean => {
   return Boolean(getTokenInfo().token);
 };
-
-// ------------------------------------权限的本地存储------------------------------------
-
-// 用户信息的本地缓存键名(包括token)
-const POWER_KEY = "LSDFGC_POWER_INFO";
-
-/**
- * 存入权限信息
- */
-export const setPowerInfo = (info: any) => {
-  localStorage.setItem(POWER_KEY, JSON.stringify(info));
-};
-
-/**
- * 取权限信息
- */
-export const getPowerInfo = (): any => {
-  const data = localStorage.getItem(POWER_KEY);
-  if (data) return JSON.parse(data);
-  else {
-    message.warning("权限信息丢失!");
-    history.push("/login");
-  }
-};
-
-/**
- * 删除本地缓存中的权限信息
- */
-export const removePowerInfo = (): void => {
-  localStorage.removeItem(POWER_KEY);
-};