功能整理

This commit is contained in:
熊潇 2025-06-30 02:12:24 +08:00
parent 143cbc877c
commit 6a9e847ff1
3 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
const unreadUrl = 'https://edith.xiaohongshu.com/api/sns/web/unread_count'; const unreadUrl = 'https://edith.xiaohongshu.com/api/sns/web/unread_count';
const cookie = const cookie =
'a1=19686f83a65uiloc0y7wv79une457hsjh5lt00dpe40000147626;abRequestId=0a794332-4561-5f49-93f7-780b8b028e1f;access-token-creator.xiaohongshu.com=customer.creator.AT-68c517498636784561614544frjvxzj7yu8iewie;agora_session=6a0031373435393132333637323735343733393437313634000000000000;customerClientId=536706778174172;galaxy_creator_session_id=OhpHDDSoADhNEhnH5LLnQpletFLApu1fd91f;galaxy.creator.beaker.session.id=1745912429847011598150;gid=yjKqYfK0qDyYyj2DDSqd4ujxyW9kvxIuT62ddkMWhElyuxq8yDd6hl888q2WYy88j8i80yYD;loadts=1746020512562;sec_poison_id=441c932e-a6ac-4d8d-97ae-beb14adb1929;unread={%22ub%22:%2267eaf1fe000000001202c3ea%22%2C%22ue%22:%226803aa37000000001c0319d8%22%2C%22uc%22:35};web_session=040069b2e9c511ca302086ca253a4bde8b1cd1;webBuild=4.62.3;webId=97e5f097499594cad49aa0bd1a8ed83f;websectiga=3633fe24d49c7dd0eb923edc8205740f10fdb18b25d424d2a2322c6196d2a4ad;x-user-id-creator.xiaohongshu.com=639d86590000000026006076;xsecappid=xhs-pc-web;acw_tc=0a00df6217460205042195762e721fba339a0dbe8e4738b961a5ff15e74619;'; 'a1=xxxx;abRequestId=0a794332-4561-5f49-93f7-780b8b028e1f;access-token-creator.xiaohongshu.com=customer.creator.AT-68c517498636784561614544frjvxzj7yu8iewie;agora_session=6a0031373435393132333637323735343733393437313634000000000000;customerClientId=536706778174172;galaxy_creator_session_id=OhpHDDSoADhNEhnH5LLnQpletFLApu1fd91f;galaxy.creator.beaker.session.id=1745912429847011598150;gid=yjKqYfK0qDyYyj2DDSqd4ujxyW9kvxIuT62ddkMWhElyuxq8yDd6hl888q2WYy88j8i80yYD;loadts=1746020512562;sec_poison_id=441c932e-a6ac-4d8d-97ae-beb14adb1929;unread={%22ub%22:%2267eaf1fe000000001202c3ea%22%2C%22ue%22:%226803aa37000000001c0319d8%22%2C%22uc%22:35};web_session=040069b2e9c511ca302086ca253a4bde8b1cd1;webBuild=4.62.3;webId=97e5f097499594cad49aa0bd1a8ed83f;websectiga=3633fe24d49c7dd0eb923edc8205740f10fdb18b25d424d2a2322c6196d2a4ad;x-user-id-creator.xiaohongshu.com=639d86590000000026006076;xsecappid=xhs-pc-web;acw_tc=0a00df6217460205042195762e721fba339a0dbe8e4738b961a5ff15e74619;';
const cookieObj = cookie.split('; ').reduce((acc, item) => { const cookieObj = cookie.split('; ').reduce((acc, item) => {
const [key, value] = item.split('='); const [key, value] = item.split('=');
@ -17,7 +17,7 @@ const headers = {
const meUri = '/api/sns/web/v2/user/me'; const meUri = '/api/sns/web/v2/user/me';
const getSign = async (uri: string, data: any, a1: string, web_session?: string) => { const getSign = async (uri: string, data: any, a1: string, web_session?: string) => {
const signs = await fetch('http://light.xiongxiao.me:5006/sign', { const signs = await fetch('http://localhost:5006/sign', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',

View File

@ -10,7 +10,6 @@ const cookie =
export const xhsRootClient: XhsClient = xhsServices.createRoot({ export const xhsRootClient: XhsClient = xhsServices.createRoot({
cookie, cookie,
signConfig: { signConfig: {
signUrl: 'http://light.xiongxiao.me:5006/sign', signUrl: 'http://localhost:5006/sign',
// signUrl: 'http://localhost:5006/sign',
}, },
}); });

View File

@ -19,6 +19,10 @@ if (isDev) {
server.setSignConfig({ server.setSignConfig({
signUrl: 'http://localhost:5006/sign', signUrl: 'http://localhost:5006/sign',
}); });
} else {
server.setSignConfig({
signUrl: config.XHS_API_SIGN_URL,
});
} }
console.log('XHS_USER_INFO', config.XHS_USER_ID, config.XHS_USER_NAME, 'XHS_ROOT_COOKIE', config.XHS_ROOT_COOKIE); console.log('XHS_USER_INFO', config.XHS_USER_ID, config.XHS_USER_NAME, 'XHS_ROOT_COOKIE', config.XHS_ROOT_COOKIE);
console.log('XHS_SIGN_URL', server.getSignConfig().signUrl); console.log('XHS_SIGN_URL', server.getSignConfig().signUrl);