兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-07-13 75e72bf974fdab85a81845f900f7fc17a9cb0126
src/layout/components/SocialCallback/index.vue
@@ -27,14 +27,20 @@
  if (res.code !== 200) {
    throw new Error(res.msg);
  }
  setToken(res.data.access_token);
  if (res.data !== null) {
    setToken(res.data.access_token);
  }
  ElMessage.success(res.msg);
  location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
  setTimeout(() => {
    location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
  }, 2000);
};
const handleError = (error: any) => {
  ElMessage.error(error.message);
  location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
  setTimeout(() => {
    location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
  }, 2000);
};
const callbackByCode = async (data: LoginData) => {
@@ -48,6 +54,7 @@
};
const loginByCode = async (data: LoginData) => {
  console.log(2)
  try {
    const res = await login(data);
    await processResponse(res);