From 4deecf8e991e1ff7c4c848b153eb5a622499c1b4 Mon Sep 17 00:00:00 2001 From: Chinaniu <477756621@qq.com> Date: Thu, 1 Feb 2024 11:18:49 +0800 Subject: [PATCH] sdsd --- packages/ui/src/store/constant.js | 8 ++-- packages/ui/src/utils/GetUsersArr.js | 60 ++++++++++++++-------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/ui/src/store/constant.js b/packages/ui/src/store/constant.js index 293129f..5eed966 100644 --- a/packages/ui/src/store/constant.js +++ b/packages/ui/src/store/constant.js @@ -3,18 +3,18 @@ export const gridSpacing = 3 export const drawerWidth = 260 export const appDrawerWidth = 320 export const maxScroll = 100000 -export const baseURL = 'http://localhost:3100' -// process.env.NODE_ENV === 'production' ? window.location.origin : window.location.origin.replace(':8080', ':3000') +// export const baseURL = 'http://localhost:3100' +export const baseURL = process.env.NODE_ENV === 'production' ? window.location.origin : window.location.origin.replace(':8080', ':3000') export const createdBy = document.cookie .split('; ') - .find((row) => row.startsWith('LOWCODER_CE_SELFHOST_TOKEN=')) + .find((row) => row.startsWith('Flowise=')) .split('=')[1] .split(':')[2] // export const createdBy = '65536f412886657aeb845dc9' // export const orgId = '65536f422886657aeb845dca' export const orgId = document.cookie .split('; ') - .find((row) => row.startsWith('LOWCODER_CE_SELFHOST_TOKEN=')) + .find((row) => row.startsWith('Flowise=')) .split('=')[1] .split(':')[4] diff --git a/packages/ui/src/utils/GetUsersArr.js b/packages/ui/src/utils/GetUsersArr.js index fc5c3db..cd2bb10 100644 --- a/packages/ui/src/utils/GetUsersArr.js +++ b/packages/ui/src/utils/GetUsersArr.js @@ -1,37 +1,37 @@ import axios from 'axios' -// import { createdBy, orgId } from 'store/constant' -// const BaseURL = '192.168.31.109' -// const PORT = 8080 -// const url = `http://${BaseURL}:${PORT}/api/users/flowIse/${createdBy}/${orgId}` - -// export function getUsersArray() { -// return axios.get(url).then((res) => { -// let Data = res.data.data -// let orgId = Object.keys(Data)[0] -// let userIdArr = Object.values(Data)[0] -// return { -// orgId, -// userIdArr -// } -// }) -// } +import { createdBy, orgId } from 'store/constant' +const BaseURL = 'localhost' +const PORT = 8080 +const url = `http://${BaseURL}:${PORT}/api/users/flowIse/${createdBy}/${orgId}` export function getUsersArray() { - return axios.get('http://localhost:3100/api/v1/ip').then(() => { + return axios.get(url).then((res) => { + let Data = res.data.data + let orgId = Object.keys(Data)[0] + let userIdArr = Object.values(Data)[0] return { - orgId: '65536f422886657aeb845dca', - userIdArr: [ - '65880ad733e3d01588e55ded', - '65536f412886657aeb845dc9', - '655afbf6a86fa408231fa9ab', - '658161561b9641349c6cc9a0', - '6559b39d5c3dcd549c8a0619', - '6576c47847b11e3155938b94', - '658265c79d210324ab9d4abb', - '655994d25c3dcd549c8a05c4', - '6588407329a7b000ccaee7b8', - '6588f8c054f31c775d0b499b' - ] + orgId, + userIdArr } }) } + +// export function getUsersArray() { +// return axios.get('http://localhost:3100/api/v1/ip').then(() => { +// return { +// orgId: '65536f422886657aeb845dca', +// userIdArr: [ +// '65880ad733e3d01588e55ded', +// '65536f412886657aeb845dc9', +// '655afbf6a86fa408231fa9ab', +// '658161561b9641349c6cc9a0', +// '6559b39d5c3dcd549c8a0619', +// '6576c47847b11e3155938b94', +// '658265c79d210324ab9d4abb', +// '655994d25c3dcd549c8a05c4', +// '6588407329a7b000ccaee7b8', +// '6588f8c054f31c775d0b499b' +// ] +// } +// }) +// }