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