Преглед на файлове

处理请求线上接口

lcl преди 8 месеца
родител
ревизия
70d5eb9db3
променени са 5 файла, в които са добавени 17 реда и са изтрити 10 реда
  1. 2 1
      src/api/user.ts
  2. 2 1
      src/utils/OSSupload.ts
  3. 9 5
      src/utils/getUrl/getUrl.js
  4. 2 2
      src/utils/http/index.ts
  5. 2 1
      vite.config.ts

+ 2 - 1
src/api/user.ts

@@ -50,7 +50,8 @@ export type RefreshTokenResult = {
 export const getLogin = (data?: object) => {
   console.log(data);
   return http.login(
-    "http://localhost:6101/v1/tel/sysServer/oauth2/token",
+    // "http://localhost:6101/v1/tel/sysServer/oauth2/token",
+    "https://logic-executor-api.kexiaoshuang.com/v1/tel/sysServer/oauth2/token",
     data
   );
 };

+ 2 - 1
src/utils/OSSupload.ts

@@ -26,7 +26,8 @@ const Ossupload = function (data, Filename = "TelAdmin/upload") {
   // eslint-disable-next-line no-async-promise-executor
   return new Promise(async (r, j) => {
     const res: Res = await http.post(
-      "http://localhost:6101/api/ossparam?t=",
+      // "http://localhost:6101/api/ossparam?t=",
+      "https://logic-executor-api.kexiaoshuang.com/api/ossparam?t=",
       {}
     );
     const client = new OSS({

+ 9 - 5
src/utils/getUrl/getUrl.js

@@ -64,12 +64,14 @@ const getURL = () => {
 const getAllPlate = () => {
   return new Promise(async (resolve, reject) => {
     postRequest(
-      "http://localhost:6101/noauth/api/groupsforadmin",
+      // "http://localhost:6101/noauth/api/groupsforadmin",
+      "https://logic-executor-api.kexiaoshuang.com/noauth/api/groupsforadmin",
       {
-        key: "kxs#2024"
+        key: "tel#2024"
       }
     )
       .then(async res => {
+        console.log(res);
         resolve(res.data.data);
       })
       .catch(err => {
@@ -86,12 +88,13 @@ const getGroupUrl = async (checkPlate = []) => {
     if (checkPlate.length == 0) {
       checkPlate = await getAllPlate();
     }
-    parameters.groups = checkPlate.map(item => {
+    console.log('123123', checkPlate);
+    parameters.groups = checkPlate ? checkPlate.map(item => {
       return {
         name: item,
         version: URLLIST && URLLIST[item] ? URLLIST[item].groupVersion : 0
       };
-    });
+    }) : [];
     const timer = setTimeout(() => {
       resolve(URLLIST);
       throw Error(
@@ -99,7 +102,8 @@ const getGroupUrl = async (checkPlate = []) => {
       );
     }, 5000);
     postRequest(
-      "http://localhost:6101/noauth/api/listforadmin",
+      // "http://localhost:6101/noauth/api/listforadmin",
+      "https://logic-executor-api.kexiaoshuang.com/noauth/api/listforadmin",
       parameters
     )
       .then(async res => {

+ 2 - 2
src/utils/http/index.ts

@@ -192,7 +192,7 @@ class PureHttp {
     axiosConfig?: PureHttpRequestConfig
   ): Promise<T> {
     //本地调试配置
-    url = url.replace("http://localhost:6101", "/aapi")
+    // url = url.replace("http://localhost:6101", "/aapi")
     const config = {
       method: "post",
       url:
@@ -236,7 +236,7 @@ class PureHttp {
     axiosConfig?: PureHttpRequestConfig
   ): any {
     //本地调试配置
-    url = url.replace("http://localhost:6101", "/aapi")
+    // url = url.replace("http://localhost:6101", "/aapi")
     const config = {
       method,
       url,

+ 2 - 1
vite.config.ts

@@ -54,7 +54,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
       proxy: {
         "/aapi": {
           // 这里填写后端地址
-          target: "http://localhost:6101",
+          // target: "http://localhost:6101",
+          target: "https://logic-executor-api.kexiaoshuang.com/",
           changeOrigin: true,
           rewrite: path => path.replace(/^\/aapi/, "")
         }