Browse Source

处理请求线上接口

lcl 8 tháng trước cách đây
mục cha
commit
70d5eb9db3

+ 2 - 1
src/api/user.ts

@@ -50,7 +50,8 @@ export type RefreshTokenResult = {
 export const getLogin = (data?: object) => {
 export const getLogin = (data?: object) => {
   console.log(data);
   console.log(data);
   return http.login(
   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
     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
   // eslint-disable-next-line no-async-promise-executor
   return new Promise(async (r, j) => {
   return new Promise(async (r, j) => {
     const res: Res = await http.post(
     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({
     const client = new OSS({

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

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

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

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

+ 2 - 1
vite.config.ts

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