-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(uploader): fix chooseImage error in PC #5477
Conversation
packages/uploader/utils.ts
Outdated
@@ -1,6 +1,15 @@ | |||
import { pickExclude } from '../common/utils'; | |||
import { isImageUrl, isVideoUrl } from '../common/validator'; | |||
|
|||
let isRunningOnPC = false; | |||
|
|||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
全局有一个 getSystemInfoSync 的工具函数,可以直接用,不用自己在写一个了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isRunningOnPC 简化一下,就叫 isPC 吧,在 utils 里面写个工具函数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok了
packages/common/utils.ts
Outdated
@@ -109,3 +113,8 @@ export function getCurrentPage<T>() { | |||
const pages = getCurrentPages(); | |||
return pages[pages.length - 1] as T & WechatMiniprogram.Page.TrivialInstance; | |||
} | |||
|
|||
export function isPC() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以作为一个场景的,例如 export const isPc = xxx ,没必须要每次使用都重新计算
#5438