fix: 调整登录检测入口URL
无 Shopee tab 时,登录检测改为打开卖家中心根地址 https://<region_host>/,默认 https://seller.shopee.tw/。 商品编辑 URL 仍保持 /portal/product 路径不变;更新登录检测单测与 API/架构/当前状态/progress 文档。
This commit is contained in:
@@ -5,6 +5,11 @@ from unittest import mock
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
|
||||
from _helpers import REPO_ROOT
|
||||
|
||||
if str(REPO_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
|
||||
from app import editor
|
||||
|
||||
|
||||
@@ -103,11 +108,11 @@ class EditorLoginTests(unittest.TestCase):
|
||||
self.assertFalse(status["logged_in"])
|
||||
self.assertEqual("NO_SESSION_COOKIE", status["reason"])
|
||||
|
||||
def test_login_status_opens_portal_when_no_shopee_page(self):
|
||||
def test_login_status_opens_seller_home_when_no_shopee_page(self):
|
||||
with mock.patch("app.editor.http_get", return_value=[]), mock.patch(
|
||||
"app.editor.create_tab", return_value="ws-new"
|
||||
) as create_tab, self.patch_cdp(
|
||||
url="https://seller.shopee.tw/portal/",
|
||||
url="https://seller.shopee.tw/",
|
||||
cookies=[cookie("SPC_U")],
|
||||
):
|
||||
status = editor.login_status(
|
||||
@@ -117,7 +122,7 @@ class EditorLoginTests(unittest.TestCase):
|
||||
|
||||
self.assertTrue(status["logged_in"])
|
||||
create_tab.assert_called_once_with(
|
||||
"https://seller.shopee.tw/portal/",
|
||||
"https://seller.shopee.tw/",
|
||||
host="127.0.0.1:9222",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user