From ccf5b14ec7d01359c825053c523f06258b47c33c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Wed, 29 Oct 2025 17:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B8=B8=E5=AE=A2=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=BB=98=E8=AE=A4=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/home/mySelections.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/api/home/mySelections.js b/api/home/mySelections.js index 4a99366..6801ebc 100644 --- a/api/home/mySelections.js +++ b/api/home/mySelections.js @@ -140,6 +140,36 @@ class MySelectionsAPI { throw error } } + + /** + * 游客查询默认自选股 + * @param {Function} successCallback - 成功回调函数 + * @param {Function} failCallback - 失败回调函数 + * @returns {Promise} + */ + static async getDefaultStocks(successCallback, failCallback = null) { + const url = '/api/homePage/userStock/getDefaultStocks' + + try { + const response = await http({ + url: url, + method: 'POST', + data: {} + }) + + console.log('游客查询默认自选股 - 响应:', response) + if (successCallback && typeof successCallback === 'function') { + successCallback(response) + } + return response + } catch (error) { + console.error('游客查询默认自选股 - 失败:', error) + if (failCallback && typeof failCallback === 'function') { + failCallback(error) + } + throw error + } + } } // 导出API类 @@ -150,5 +180,6 @@ export const { checkExist, getUserStockGroupList, getUserStockList, - getUserOrDefault + getUserOrDefault, + getDefaultStocks } = MySelectionsAPI \ No newline at end of file