##
luxiaotao1123
2024-02-07 8f7f2515576a889ac57e84b9d596055ee336a388
##
6个文件已修改
44 ■■■■ 已修改文件
zy-asrs-flow/src/App.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/components/RightContent/AvatarDropdown.tsx 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/config/setting.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/User/Login/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/services/route.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/tsconfig.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/App.jsx
@@ -9,6 +9,7 @@
import { getRemoteMenu, getRoutersInfo, getUserInfo, setRemoteMenu, patchRouteWithRemoteMenus } from './services/route';
import { getToken } from '@/utils/token-util'
import { TOKEN_HEADER_NAME, TOKEN_STORE_NAME } from '@/config/setting';
import { API_BASE_URL } from '@/config/setting'
const isDev = process.env.NODE_ENV === 'development';
const loginPath = '/user/login';
@@ -182,7 +183,7 @@
 * @doc https://umijs.org/docs/max/request#配置
 */
export const request = {
  // baseURL: 'http://localhost:9999',
  baseURL: API_BASE_URL,
  ...errorConfig,
  timeout: 60000,
  // 前置守卫
zy-asrs-flow/src/components/RightContent/AvatarDropdown.tsx
@@ -8,6 +8,8 @@
import React, { useCallback } from 'react';
import { flushSync } from 'react-dom';
import HeaderDropdown from '../HeaderDropdown';
import { setRemoteMenu } from '@/services/route'
import { removeToken } from '@/utils/token-util'
export type GlobalHeaderRightProps = {
  menu?: boolean;
@@ -43,7 +45,9 @@
   * 退出登录,并且将当前的 url 保存
   */
  const loginOut = async () => {
    await outLogin();
    // await outLogin();
    removeToken();
    setRemoteMenu(null);
    const { search, pathname } = window.location;
    const urlParams = new URL(window.location.href).searchParams;
    /** 此方法会跳转到 redirect 参数所在的位置 */
@@ -102,20 +106,20 @@
  const menuItems = [
    ...(menu
      ? [
          {
            key: 'center',
            icon: <UserOutlined />,
            label: '个人中心',
          },
          {
            key: 'settings',
            icon: <SettingOutlined />,
            label: '个人设置',
          },
          {
            type: 'divider' as const,
          },
        ]
        {
          key: 'center',
          icon: <UserOutlined />,
          label: '个人中心',
        },
        {
          key: 'settings',
          icon: <SettingOutlined />,
          label: '个人设置',
        },
        {
          type: 'divider' as const,
        },
      ]
      : []),
    {
      key: 'logout',
zy-asrs-flow/src/config/setting.ts
@@ -1,5 +1,5 @@
// 接口地址
export const API_BASE_URL: string = '';
export const API_BASE_URL: string = 'http://localhost:9090/wcs';
// 项目名称
export const PROJECT_NAME: string = '';
zy-asrs-flow/src/pages/User/Login/index.jsx
@@ -104,7 +104,6 @@
  const handleSubmit = async (values) => {
    try {
      const r = await request('/api/login', {
        baseURL: 'http://localhost:9090/wcs',
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
zy-asrs-flow/src/services/route.js
@@ -14,7 +14,6 @@
export async function getUserInfo(options) {
    return request('/api/auth/user', {
        baseURL: 'http://localhost:9090/wcs',
        method: 'GET',
        ...(options || {}),
    });
@@ -22,7 +21,6 @@
export async function getRouters() {
    return request('/api/auth/menu', {
        baseURL: 'http://localhost:9090/wcs'
    });
}
zy-asrs-flow/tsconfig.json
@@ -19,5 +19,5 @@
      "@@test/*": ["./src/.umi-test/*"]
    }
  },
  "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx", "src/app.tsx", "src/utils/icon-util.js", "src/pages/User/Login/index.jsx", "src/components/Footer/index.jsx"]
  "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx", "src/app.tsx", "src/utils/icon-util.js", "src/pages/User/Login/index.jsx", "src/components/Footer/index.jsx", "src/components/HeaderDropdown/index.jsx"]
}