Update index.ts 更新了注释中的一些空格使用

有一些强迫症,把这个文件中的注释规范了一下
This commit is contained in:
程序员小墨 2025-02-25 00:36:18 +08:00 committed by feige996
parent ff29decfba
commit 2fd8e45c31

View File

@ -4,18 +4,18 @@ import { isMpWeixin } from './platform'
const getLastPage = () => {
// getCurrentPages() 至少有1个元素所以不再额外判断
// const lastPage = getCurrentPages().at(-1)
// 上面那个在低版本安卓中打包报错所以改用下面这个【虽然我加了src/interceptions/prototype.ts但依然报错】
// 上面那个在低版本安卓中打包报错,所以改用下面这个【虽然我加了 src/interceptions/prototype.ts但依然报错】
const pages = getCurrentPages()
return pages[pages.length - 1]
}
/** 判断当前页面是否是tabbar页 */
/** 判断当前页面是否是 tabbar 页 */
export const getIsTabbar = () => {
if (!tabBar) {
return false
}
if (!tabBar.list.length) {
// 通常有tabBar的话list不能有空且至少有2个元素这里其实不用处理
// 通常有 tabBar 的话list 不能有空且至少有2个元素这里其实不用处理
return false
}
const lastPage = getLastPage()
@ -25,8 +25,8 @@ export const getIsTabbar = () => {
/**
* path redirectPath
* path /pages/login/index
* redirectPath /pages/demo/base/route-interceptor
* path '/pages/login/index'
* redirectPath '/pages/demo/base/route-interceptor'
*/
export const currRoute = () => {
const lastPage = getLastPage()
@ -73,9 +73,9 @@ export const getUrlObj = (url: string) => {
return { path, query }
}
/**
* pages
* key作为判断依据 needLogin, route-block 使
* keypages key, key
* pages
* key needLogin, route-block 使
* key pages key, key
*/
export const getAllPages = (key = 'needLogin') => {
// 这里处理主包
@ -108,19 +108,19 @@ export const getAllPages = (key = 'needLogin') => {
}
/**
* pages
* pages
* path
*/
export const getNeedLoginPages = (): string[] => getAllPages('needLogin').map((page) => page.path)
/**
* pages
* pages
* path
*/
export const needLoginPages: string[] = getAllPages('needLogin').map((page) => page.path)
/**
* BaseUrl
* baseUrl
*/
export const getEnvBaseUrl = () => {
// 请求基准地址
@ -149,7 +149,7 @@ export const getEnvBaseUrl = () => {
}
/**
* UPLOAD_BASEURL
* UPLOAD_BASEURL
*/
export const getEnvBaseUploadUrl = () => {
// 请求基准地址