Skip to content

Conversation

@nadirvishun
Copy link

path = location.pathname + location.search;
// #endif
const BASIC_CONFIG = Cache.get('BASIC_CONFIG')
if (!pathLogin)
pathLogin = '/page/users/login/index'
Cache.set('login_back_url', path);

上述是原有代码,有两个问题:

  • pathLogin 路径应该是/pages/users/login/index而不是page,但由于pathLogin 没有后续使用,所以没有引发报错。
  • path不能等于pathLogin,否则登录后还是跳转登录页面

目前修改为:

	path = location.pathname + location.search;
	// #endif
	const BASIC_CONFIG = Cache.get('BASIC_CONFIG')
	if (!pathLogin)
		pathLogin = '/pages/users/login/index'
	//不能等于登录地址,否则登录后还是登录页面
	if (path !== pathLogin) {
	        Cache.set('login_back_url', path);
	}

@pk2993635720
Copy link

pk2993635720 commented Jun 30, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants