兰宝车间质量管理系统-前端
疯狂的狮子Li
2024-06-18 72610ab1948bf57e0073a0dd377ab84393459ca0
src/layout/components/SocialCallback/index.vue
@@ -17,18 +17,22 @@
const code = route.query.code as string;
const state = route.query.state as string;
const source = route.query.source as string;
const tenantId = localStorage.getItem('tenantId') ? (localStorage.getItem('tenantId') as string) : '000000';
const tenantId = route.query.tenantId as string ? route.query.tenantId as string : '000000';
const processResponse = async (res: any) => {
  if (res.code !== 200) {
    throw new Error(res.msg);
  }
  if (res.data !== null) {
  if (res.data !== null && res.data.access_token !== null) {
    setToken(res.data.access_token);
  }
  ElMessage.success(res.msg);
  setTimeout(() => {
    location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
    if (res.data !== null  && res.data.domain !== null) {
      location.href = res.data.domain + import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
    } else {
      location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
    }
  }, 2000);
};