瀏覽代碼

收藏接口用户ID修改

S0025136190 5 月之前
父節點
當前提交
291f3c11a5
共有 1 個文件被更改,包括 3 次插入7 次删除
  1. 3 7
      app/components/sidebar.tsx

+ 3 - 7
app/components/sidebar.tsx

@@ -230,8 +230,7 @@ const AppDrawer: React.FC<AppDrawerProps> = (props) => {
   const fetchAppList = async () => {
   const fetchAppList = async () => {
     setListLoading(true);
     setListLoading(true);
     try {
     try {
-      const userId = '7';
-      const res = await api.get(`/deepseek/api/project/app/${userId}`);
+      const res = await api.get(`/deepseek/api/project/app`);
       if (type === 'all') {
       if (type === 'all') {
         setList(res.data);
         setList(res.data);
       } else {
       } else {
@@ -247,10 +246,8 @@ const AppDrawer: React.FC<AppDrawerProps> = (props) => {
   // 收藏应用
   // 收藏应用
   const collectApp = async (appId: string) => {
   const collectApp = async (appId: string) => {
     try {
     try {
-      const userId = '7';
       await api.post('/deepseek/api/app/collect', {
       await api.post('/deepseek/api/app/collect', {
-        appId: appId,
-        userId: userId,
+        appId: appId
       });
       });
       message.success('收藏成功');
       message.success('收藏成功');
       await fetchAppList();
       await fetchAppList();
@@ -262,8 +259,7 @@ const AppDrawer: React.FC<AppDrawerProps> = (props) => {
   // 取消收藏应用
   // 取消收藏应用
   const cancelCollectApp = async (appId: string) => {
   const cancelCollectApp = async (appId: string) => {
     try {
     try {
-      const userId = '7';
-      await api.delete(`/deepseek/api/app/collect/${userId}/${appId}`);
+      await api.delete(`/deepseek/api/app/collect/${appId}`);
       message.success('操作成功');
       message.success('操作成功');
       await fetchAppList();
       await fetchAppList();
     } catch (error: any) {
     } catch (error: any) {