fix-0609-xwk
向文可 3 years ago
parent fc9d339606
commit 3eceb0c3f3

@ -100,13 +100,13 @@ const actions = {
} }
return res; return res;
}, },
logout: ({ commit }, returnUrl) => { logout: async ({ commit }, returnUrl) => {
returnUrl = returnUrl || router.currentRoute.value.fullPath; returnUrl = returnUrl || router.currentRoute.value.fullPath;
console.info('[logout]', returnUrl); console.info('[logout]', returnUrl);
commit('local/setToken', null, { root: true }); commit('local/setToken', null, { root: true });
commit('auth/setPermission', [], { root: true }); commit('auth/setPermission', [], { root: true });
commit('layout/setReturnUrl', returnUrl, { root: true }); await router.push({ name: 'Login', query: { returnUrl } });
router.push({ name: 'Login', query: { returnUrl } }); location.reload();
}, },
getPermission: async ({ commit }) => { getPermission: async ({ commit }) => {
let res = await getPermission(); let res = await getPermission();

@ -44,6 +44,8 @@
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const store = useStore(); const store = useStore();
const route = useRoute();
store.commit('layout/setReturnUrl', route.query.returnUrl);
const refsForm = ref(null); const refsForm = ref(null);
// const sending = ref(false); // const sending = ref(false);

@ -133,7 +133,7 @@
state.form.id = id; state.form.id = id;
let res = await store.dispatch('product/detail', id); let res = await store.dispatch('product/detail', id);
if (res) { if (res) {
Object.assign(state.form, state.form); Object.assign(state.form, res);
} }
res = await store.dispatch('productSkus/search', id); res = await store.dispatch('productSkus/search', id);
state.form.skuInfos = res.map((item) => { state.form.skuInfos = res.map((item) => {

Loading…
Cancel
Save