fix(api): 修正用户ID从URLfix(api参数):中 修获取正用户逻ID辑参数
- 优先从current_user_id参数获取获取逻辑 用户-ID 优 先-从 保 URL 参数 current持_user对user_id 中获取用户 ID - 保留原Id有、 useriduserid和user_id参数的、兼user容 - 优化了Id代码 和的注 user释_id格式 参数和的排兼版容细处理节 - 优化了函数注释格式,去除多余空格 - 确保获取到的用户
This commit is contained in:
parent
0de192c9b4
commit
f10dff016f
|
|
@ -25,7 +25,7 @@ const API_BASE = getApiBase();
|
||||||
*/
|
*/
|
||||||
const getUserId = () => {
|
const getUserId = () => {
|
||||||
const params = new URLSearchParams(window.location.search || '');
|
const params = new URLSearchParams(window.location.search || '');
|
||||||
const value = params.get('userId') || params.get('userid') || params.get('user_id');
|
const value = params.get('current_user_id') || params.get('userId') || params.get('userid') || params.get('user_id');
|
||||||
return value && String(value).trim() ? String(value).trim() : '';
|
return value && String(value).trim() ? String(value).trim() : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue