yanghao пре 2 недеља
родитељ
комит
4d9de0ebe0
3 измењених фајлова са 3 додато и 21 уклоњено
  1. 0 4
      components.d.ts
  2. 0 12
      src/api/user.ts
  3. 3 5
      src/views/index.vue

+ 0 - 4
components.d.ts

@@ -14,14 +14,10 @@ declare module 'vue' {
     CardItem: typeof import('./src/components/home/CardItem.vue')['default']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
     ElDropdown: typeof import('element-plus/es')['ElDropdown']
     ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
     ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
-    ElForm: typeof import('element-plus/es')['ElForm']
-    ElFormItem: typeof import('element-plus/es')['ElFormItem']
-    ElInput: typeof import('element-plus/es')['ElInput']
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']

+ 0 - 12
src/api/user.ts

@@ -47,15 +47,3 @@ export const ssoLogin = (data: any) => {
     data,
   });
 };
-
-export const dingTalkLogin = (data: {
-  code: string;
-  type: number;
-  state: number;
-}) => {
-  return request.post({
-    url: "/system/auth/h5SocialLogin",
-    data,
-    headers: { "tenant-id": 1 },
-  });
-};

+ 3 - 5
src/views/index.vue

@@ -66,11 +66,9 @@
 </template>
 
 <script setup lang="ts">
-import { onMounted, ref } from "vue";
+import { onMounted } from "vue";
 import * as authUtil from "@/utils/auth";
 import * as dd from "dingtalk-jsapi";
-import { ElLoading } from "element-plus";
-import { dingTalkLogin } from "@/api/user";
 import Header from "@components/home/header.vue";
 import CardItem from "@components/home/CardItem.vue";
 import Footer from "@components/home/Footer.vue";
@@ -181,8 +179,8 @@ async function loginWithDingTalk() {
 
           authUtil.setToken(res.data.data);
 
-          router.replace({
-            path: "/",
+          router.push({
+            path: "/login",
           });
         });
     },