feat:新增登录页面与相关功能,移除自动登录,对接用户反馈功能

This commit is contained in:
2025-10-08 02:29:48 +08:00
parent 0ec86fba8e
commit 8560ff778e
10 changed files with 317 additions and 35 deletions
+15 -2
View File
@@ -149,8 +149,8 @@
try {
const token = uni.getStorageSync('token');
if (!token) {
await wxLogin();
return;
redirectToLogin()
return
}
const res = await getUserInfo();
@@ -183,6 +183,19 @@
}
};
const redirectToLogin = () => {
try {
const pages = getCurrentPages()
const current = pages && pages.length ? pages[pages.length - 1] : null
const route = current && current.route ? ('/' + current.route) : '/pages/index/index'
const query = current && current.options ? Object.keys(current.options).map(k => `${k}=${encodeURIComponent(current.options[k])}`).join('&') : ''
const redirect = encodeURIComponent(query ? `${route}?${query}` : route)
uni.reLaunch({ url: `/pages/login/index?redirect=${redirect}` })
} catch (e) {
uni.reLaunch({ url: '/pages/login/index' })
}
}
// 导航到指定页面
const navigateTo = (url) => {
uni.navigateTo({