feat:新增登录页面与相关功能,移除自动登录,对接用户反馈功能
This commit is contained in:
+18
-3
@@ -128,6 +128,18 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
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' })
|
||||
}
|
||||
}
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
@@ -318,7 +330,8 @@
|
||||
const loadPositions = async () => {
|
||||
try {
|
||||
if (!uni.getStorageSync('token')) {
|
||||
await wxLogin()
|
||||
redirectToLogin()
|
||||
return
|
||||
}
|
||||
|
||||
const res = await uni.request({
|
||||
@@ -387,7 +400,8 @@
|
||||
const loadPositionsByCenter = async (center) => {
|
||||
try {
|
||||
if (!uni.getStorageSync('token')) {
|
||||
await wxLogin()
|
||||
redirectToLogin()
|
||||
return
|
||||
}
|
||||
|
||||
// 使用原有接口获取所有场地
|
||||
@@ -511,7 +525,8 @@
|
||||
}
|
||||
|
||||
if (!uni.getStorageSync('token')) {
|
||||
await wxLogin()
|
||||
redirectToLogin()
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否有使用中的订单
|
||||
|
||||
Reference in New Issue
Block a user