删除供应商切换功能,使用 PageSpy 替换

feature/price_manager
Jimmy Liow 1 year ago
parent 03ac61fad0
commit 696f2bb816

Binary file not shown.

@ -5,7 +5,6 @@ export const PROJECT_NAME = "GHHub";
export const HT_HOST = import.meta.env.PROD ? "https://p9axztuwd7x8a7.mycht.cn" :"http://202.103.68.144:890"; //"http://202.103.68.231:889";
export const DATE_FORMAT = "YYYY-MM-DD";
export const DATE_FORMAT_MONTH = "YYYY-MM";
export const arrManager = ["testzp","testzac","testycc","testlyj","testqqs","testjjh","testhn"];//特定账号加修改所属供应商的菜单 zp
const __BUILD_VERSION__ = `__BUILD_VERSION__`.replace(/"/g, '')
export const BUILD_VERSION = import.meta.env.PROD ? __BUILD_VERSION__ : import.meta.env.MODE;

@ -19,46 +19,8 @@ import { BUILD_VERSION, } from '@/config';
const { Header, Content, Footer } = Layout;
const { Title } = Typography;
let items = [];
const useItemDefault = () => {
const [data, setData] = useState([]);
const { t, i18n } = useTranslation();
useEffect(() => {
const newData = [
{ label: <Link to='/account/change-password'>{t('ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('Profile')}</Link>, key: '1' },
{ type: 'divider' },
{ label: <Link to='/login?out'>{t('Logout')}</Link>, key: '3' },
];
setData(newData);
}, [i18n.language]);
return data;
};
const useItemManager = () => {
const items_default = useItemDefault();
const [data, setData] = useState(items_default);
const { t, i18n } = useTranslation();
useEffect(() => {
const newData = [
{ label: <Link to='/account/change-password'>{t('ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('Profile')}</Link>, key: '1' },
{ type: 'divider' },
{ label: <Link to='/login?out'>{t('Logout')}</Link>, key: '3' },
{ label: <Link to='/account/change-vendor'>{t('ChangeVendor')}</Link>, key: '4' },
];
setData(newData);
}, [i18n.language]);
return data;
};
function App() {
const { t, i18n } = useTranslation();
const items_default = useItemDefault();
const item_manager = useItemManager();
const [password, setPassword] = useState('');
const { authStore, noticeStore } = useStore();
@ -70,14 +32,6 @@ function App() {
const navigate = useNavigate();
const location = useLocation();
const arrManager = config.arrManager; // ["testzp","testzac","testycc","testlyj","testqqs","testjjh","testhn"];// zp
if (arrManager.includes(authStore.login.username)){
items = item_manager;
}else{
items = items_default;
}
useEffect(() => {
if (href !== '/login' && isEmpty(loginToken)) {
navigate('/login');
@ -194,7 +148,12 @@ function App() {
<Col span={2}>
<Dropdown
menu={{
items: [...items,
items: [...[
{ label: <Link to='/account/change-password'>{t('ChangePassword')}</Link>, key: '0' },
{ label: <Link to='/account/profile'>{t('Profile')}</Link>, key: '1' },
{ type: 'divider' },
{ label: <Link to='/login?out'>{t('Logout')}</Link>, key: '3' },
],
{ type: 'divider' },
{ label: <>v{BUILD_VERSION}</>, key: 'BUILD_VERSION' },
],

Loading…
Cancel
Save