数据库文档编写,开发规范文档,数据库接入

This commit is contained in:
comlibmb
2026-02-02 18:09:30 +08:00
parent 19970db288
commit 21149dd3fe
36 changed files with 3245 additions and 89 deletions

View File

@@ -0,0 +1,20 @@
import { getUserIdOrNull } from './auth.uts'
import { toLoginWithRedirect, getCurrentPageUrlWithQuery } from '@/utils/authRedirect.uts'
export type EnsureLoginOptions = {
redirectUrl?: string
toastTitle?: string
}
export function ensureAnalyticsLogin(opts?: EnsureLoginOptions): boolean {
const uid = getUserIdOrNull()
if (uid != null && uid !== '') return true
const target = (opts?.redirectUrl != null && opts?.redirectUrl?.length > 0)
? opts?.redirectUrl as string
: getCurrentPageUrlWithQuery()
uni.showToast({ title: opts?.toastTitle ?? '请先登录', icon: 'none' })
toLoginWithRedirect(target)
return false
}