修改env
This commit is contained in:
6
.env
6
.env
@@ -1,6 +1,8 @@
|
|||||||
VITE_SUPABASE_URL=https://base.uppmkt.com
|
VITE_SUPABASE_URL=https://base.uppmkt.com
|
||||||
VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
|
|
||||||
VITE_DIFY_API_KEY=app-OK28lKfA6Ib82K0B4vwZcsXK
|
VITE_DIFY_API_KEY=app-OK28lKfA6Ib82K0B4vwZcsXK
|
||||||
|
# 前端用户
|
||||||
|
VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
|
||||||
|
# 后端用户
|
||||||
|
VITE_SUPABASE_ADMIN_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ let supabaseInstance = null;
|
|||||||
export const createSupabase = () => {
|
export const createSupabase = () => {
|
||||||
if (!supabaseInstance) {
|
if (!supabaseInstance) {
|
||||||
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
|
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
|
||||||
|
// const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ADMIN_KEY;
|
||||||
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
|
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
|
||||||
|
|
||||||
if (!supabaseUrl || !supabaseAnonKey) {
|
if (!supabaseUrl || !supabaseAnonKey) {
|
||||||
throw new Error('Missing Supabase environment variables');
|
throw new Error('Missing Supabase environment variables');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ export function useDifyChat() {
|
|||||||
if (line.startsWith('data: ')) {
|
if (line.startsWith('data: ')) {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(line.slice(6));
|
const data = JSON.parse(line.slice(6));
|
||||||
|
|
||||||
switch (data.event) {
|
switch (data.event) {
|
||||||
case 'workflow_started':
|
case 'workflow_started':
|
||||||
if (data.conversation_id) {
|
if (data.conversation_id) {
|
||||||
@@ -102,12 +101,13 @@ export function useDifyChat() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'error':
|
case 'error':
|
||||||
throw new Error(data.data?.message || '未知错误');
|
const errorMessage = data.message || data.data?.message || '未知错误';
|
||||||
|
message.error(errorMessage);
|
||||||
|
await reader.cancel();
|
||||||
|
throw new Error(errorMessage);
|
||||||
case 'done':
|
case 'done':
|
||||||
console.log('Stream completed');
|
console.log('Stream completed');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,15 +76,18 @@ export const useResources = (initialPagination, initialSorter, type) => {
|
|||||||
|
|
||||||
const deleteResource = async (id) => {
|
const deleteResource = async (id) => {
|
||||||
try {
|
try {
|
||||||
await resourceService.deleteResource(id, type);
|
const data= await resourceService.deleteResource(id, type);
|
||||||
|
if(data?.length>0){
|
||||||
const newCurrent =
|
const newCurrent =
|
||||||
resources.length === 1 && currentPagination.current > 1
|
resources.length === 1 && currentPagination.current > 1
|
||||||
? currentPagination.current - 1
|
? currentPagination.current - 1
|
||||||
: currentPagination.current;
|
: currentPagination.current;
|
||||||
await fetchResources({ current: newCurrent });
|
await fetchResources({ current: newCurrent });
|
||||||
message.success("删除成功");
|
message.success("删除成功");
|
||||||
|
}else{
|
||||||
|
throw new Error("no level");
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error("删除失败");
|
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
7
src/pages/resource/role/index.jsx
Normal file
7
src/pages/resource/role/index.jsx
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function index() {
|
||||||
|
return (
|
||||||
|
<div>index</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -45,14 +45,18 @@ export const ExpandedMemberships = ({ teamId }) => {
|
|||||||
|
|
||||||
const handleUpdate = async (id, values) => {
|
const handleUpdate = async (id, values) => {
|
||||||
try {
|
try {
|
||||||
await supabaseService.update('team_membership',
|
const data = await supabaseService.update('team_membership',
|
||||||
{ id },
|
{ id },
|
||||||
{
|
{
|
||||||
role: values.role
|
role: values.role
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
message.success('成员角色已更新');
|
if(data.length>0){
|
||||||
await loadMemberships();
|
message.success('成员角色已更新');
|
||||||
|
loadMemberships()
|
||||||
|
}else{
|
||||||
|
message.error('更新成员角色失败');
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('更新成员角色失败');
|
message.error('更新成员角色失败');
|
||||||
console.error('Update failed:', error);
|
console.error('Update failed:', error);
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ const resourceRoutes = [
|
|||||||
icon: "team",
|
icon: "team",
|
||||||
roles: ["OWNER"],
|
roles: ["OWNER"],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "role",
|
||||||
|
component: lazy(() => import("@/pages/resource/role")),
|
||||||
|
name: "角色管理",
|
||||||
|
icon: "setting",
|
||||||
|
roles: ["OWNER"],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "bucket",
|
path: "bucket",
|
||||||
component: lazy(() => import("@/pages/resource/bucket")),
|
component: lazy(() => import("@/pages/resource/bucket")),
|
||||||
|
|||||||
Reference in New Issue
Block a user