libushang 8 ヶ月 前
コミット
427dbe35ca
5 ファイル変更17 行追加5 行削除
  1. 1 1
      .env.development
  2. 3 2
      .env.production
  3. 5 0
      src/api/login.ts
  4. 7 1
      src/components/YzyCallback/index.vue
  5. 1 1
      src/router/routes.ts

+ 1 - 1
.env.development

@@ -14,4 +14,4 @@ VITE_BASE_DOWNLOAD_API = '/api/file/download/'
 VITE_ENABLE_ERUDA = "false"
 
 # 线上环境平台打包路径
-VITE_PUBLIC_PATH = /
+VITE_PUBLIC_PATH = /yjxp/

+ 3 - 2
.env.production

@@ -1,8 +1,9 @@
 # baseUrl
-VITE_BASE_API = "http://19.155.220.206:8088"
+# VITE_BASE_API = "http://19.155.220.206:8088"
+VITE_BASE_API = "/"
 
 # 线上环境平台打包路径
-VITE_PUBLIC_PATH = "/"
+VITE_PUBLIC_PATH = "/yjxp/"
 
 # 生产环境是否启用 cdn
 VITE_CDN_DEPS = "false"

+ 5 - 0
src/api/login.ts

@@ -51,6 +51,11 @@ export function callback(data): AxiosPromise<any> {
   };
   return request({
     url: '/auth/yzy/callback',
+    headers: {
+      isToken: false,
+      isEncrypt: true,
+      repeatSubmit: false
+    },
     method: 'post',
     data: LoginData
   });

+ 7 - 1
src/components/YzyCallback/index.vue

@@ -4,7 +4,7 @@
 
 <script setup lang="ts">
 import { ref, onMounted, nextTick } from 'vue';
-import { useRoute } from 'vue-router';
+import { useRoute, useRouter } from 'vue-router';
 import { login, callback } from '@/api/login';
 import { setToken, getToken } from '@/utils/auth';
 import { LoginData } from '@/api/types';
@@ -13,6 +13,9 @@ import { showSuccessToast, showFailToast, Loading } from "vant";
 const route = useRoute();
 const loading = ref(true);
 
+const router = useRouter();
+const a = route.query;
+console.log('a:', a);
 /**
  * 接收Route传递的参数
  * @param {Object} route.query.
@@ -23,6 +26,9 @@ const source = route.query.source as string;
 // const stateJson = JSON.parse(atob(state));
 // const tenantId = (stateJson.tenantId as string) ? (stateJson.tenantId as string) : '000000';
 // const domain = stateJson.domain as string;
+debugger;     
+
+console.log('code:', code);
 
 const processResponse = async (res: any) => {
   if (res.code !== 200) {

+ 1 - 1
src/router/routes.ts

@@ -9,7 +9,7 @@ const routes: Array<RouteRecordRaw> = [
     component: Index
   },
   {
-    path: "/yzy-callback",
+    path: "/yzy/callback",
     name: "YzyCallback",
     component: () => import('@/components/YzyCallback/index.vue')
   },