Commit 12d44049 authored by 前端-许佳敏's avatar 前端-许佳敏

fix: 修复在商城端退出登录后也能退出能力中心

parent 98e1af9d
......@@ -171,11 +171,11 @@ module.exports = {
ssh: JSON.stringify({
user: "root",
// Password optional, prompted if none given
password: "Shushangyun520",
host: "10.0.1.220",
password: "123456",
host: "10.0.0.17",
port: 22,
localRoot: path.resolve('./dist/'),
remoteRoot: "/home/www/v2member/",
remoteRoot: "/home/www/v2scm-member/",
// include: ["*", "**/*"], // this would upload everything except dot files
include: ["*"],
// e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
......
......@@ -158,6 +158,8 @@ export function render(oldRender: Function) {
oldRender()
})
} else {
removeAuth()
removeRouters()
oldRender()
}
}
......
......@@ -24,6 +24,7 @@ import NiceForm from '@/components/NiceForm'
import { createFormActions, FormEffectHooks } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from './effect'
import { getAuth } from '@/utils/auth'
const { Option } = Select;
const { confirm } = Modal;
......@@ -391,8 +392,8 @@ const Products: React.FC<{}> = () => {
// 判断上架之前是否有店铺 有即可以上下架
if(judgeShopRef.current){
PublicApi.getTemplateWebMemberShopWebFindCurrMemberShop({
memberId: JSON.parse(window.localStorage.getItem('auth') || window.localStorage.getItem('AUTH')).memberId,
memberRoleId: JSON.parse(window.localStorage.getItem('auth') || window.localStorage.getItem('AUTH')).memberRoleId
memberId: getAuth().memberId,
memberRoleId: getAuth().memberRoleId
}).then(res => {
if(res.data.id){
setShopId(res.data.id)
......
......@@ -14,6 +14,7 @@ import NestTable from '@/components/NestTable'
import { PublicApi } from '@/services/api'
import { getUnitPriceTotal } from '../../model/useProductTable'
import { usePageStatus } from '@/hooks/usePageStatus'
import { getAuth } from '@/utils/auth'
export interface MergeOrderModalTableProps {
title: string,
......@@ -63,7 +64,7 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => {
const getMergeOrderList = (params) => {
setLoading(true)
let memberId = JSON.parse(localStorage.getItem("auth") || localStorage.getItem("AUTH"))["memberId"]
let memberId = getAuth().memberId
PublicApi.getOrderMergeOrderList({...params, memberId}).then(res => {
setDataSource(res.data)
setLoading(false)
......
......@@ -48,12 +48,16 @@ export const setLocalAuth = (info: AuthInfo) => {
export const getAuth = (): AuthInfo => {
try {
// const localAuth: AuthInfo = getCookie('AUTH') as unknown as AuthInfo
const cookieAuth: AuthInfo = getCookie(AUTH_KEY) as unknown as AuthInfo
// return (localAuth || {}) as AuthInfo
if (!cookieAuth) {
// cookie不存在 说明在其他商城端已退出登录
return null as AuthInfo
}
const localAuth = JSON.parse(window.localStorage.getItem(AUTH_KEY))
return (localAuth || {} )as AuthInfo
} catch (error) {
return {} as AuthInfo
return null as AuthInfo
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment