uniapp-permissions
Skill0 starsChanged 18 days agoMITView on GitHub
uni-app 权限申请(定位、相机、相册、录音、通知、蓝牙)及隐私协议合规。调用需要授权的 API 或处理用户拒绝授权时使用。
In this repository11 other files it gives its agents.
- pinia-storeSkill
- release-checklistSkill
- uniapp-cross-platformSkill
- uniapp-loginSkill
- uniapp-paymentSkill
- uniapp-performanceSkill
- uniapp-project-structureSkill
- uniapp-requestSkill
- uniapp-subpackagesSkill
- uniapp-ui-libsSkill
- vue3-compositionSkill
The file
Files
权限与隐私
小程序流程
- 在
manifest.json → mp-weixin.permission / requiredPrivateInfos声明(如getLocation、chooseLocation),并在小程序后台完善《用户隐私保护指引》。 - 先
uni.getSetting判断,未授权再uni.authorize;被拒后只能引导uni.openSetting。
export async function ensureScope(scope: string, tip: string) {
const { authSetting } = await uni.getSetting()
if (authSetting[scope]) return true
if (authSetting[scope] === false) {
const { confirm } = await uni.showModal({ title: '需要授权', content: tip, confirmText: '去设置' })
if (!confirm) return false
const r = await uni.openSetting()
return !!r.authSetting[scope]
}
try { await uni.authorize({ scope }); return true } catch { return false }
}- 隐私接口受隐私协议限制时,使用
<button open-type="agreePrivacyAuthorization">或uni.onNeedPrivacyAuthorization弹窗。
App 端
- Android 在 manifest 勾选权限,并在首次启动弹隐私政策、同意前不初始化任何 SDK(应用商店审核必查)。
- 申请权限前先弹“为什么需要”说明(华为/小米等商店要求),用
plus.android.requestPermissions或 uni 官方权限判断方案。 - iOS 在 manifest 填写各
NSxxxUsageDescription,文案写清用途。
原则
按需申请、用到再申请;拒绝后功能降级而不是卡死;不要启动就索要全部权限。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

