提交 f2eea22a 编写于 作者: DCloud_JSON's avatar DCloud_JSON

预置uniCloud admin依赖的uniCloud文件,方便uniCloud admin与uni-starter配套使用时免做文件迁移

上级 1435c9e2
## 1.0.25(2021-06-23)
预置uniCloud admin依赖的uniCloud文件,方便uniCloud admin与uni-starter配套使用时免做文件迁移
## 1.0.24(2021-06-23)
删除callFunction拦截器中多余的代码
## 1.0.23(2021-06-22)
......
......@@ -235,7 +235,7 @@ export default function() {
//获取用户的token
const token = uni.getStorageSync('uni_id_token')
//token是否已失效
const tokenExpired = (uni.getStorageSync('uni_id_token_expired') - Date.now()) < 0
const tokenExpired = uni.getStorageSync('uni_id_token_expired') < Date.now()
//获取当前页面路径(即url去掉"?"和"?"后的参数)
const url = e.url.split('?')[0]
//控制登录优先级
......
{
"id": "uni-starter",
"displayName": "uni-starter",
"version": "1.0.24",
"version": "1.0.25",
"description": "云端一体应用快速开发基本项目模版",
"keywords": [
"uni-starter",
......
......@@ -24,7 +24,6 @@ let state = {
console.log('state.info',state.info);
//存储最新的用户数据到本地持久化存储
uni.setStorageSync('userInfo', state.info);
uni.setStorageSync('uni_id_uid', state.info._id)
uni.setStorageSync('uni_id_token', state.info.token)
uni.setStorageSync('uni_id_token_expired', state.info.tokenExpired)
......@@ -34,6 +33,7 @@ let state = {
state.hasLogin = false;
uni.setStorageSync('userInfo', {});
uni.setStorageSync('uni_id_token', '');
uni.setStorageSync('uni_id_token_expired', 0)
}
},
actions = {
......
......@@ -26,7 +26,7 @@ module.exports = {
"/pages/ucenter/userinfo/uploadCutImageToUnicloud",
"/uni_modules/uni-feedback/pages/uni-feedback/add"
],
"login": ["univerify","smsCode","username", "weixin", "apple"],
"login": ["username","smsCode","univerify", "weixin", "apple"],
/*
根据数组的第0项,决定登录方式的第一优先级。
未列举到的,或设备环境不支持的选项,将被隐藏。
......
// 在本文件中可配置云数据库初始化,数据格式见:https://uniapp.dcloud.io/uniCloud/cf-database?id=db_init
// 编写完毕后对本文件点右键,可按配置规则创建表和添加数据
{
"opendb-verify-codes": {
"data": []
},
"uni-id-roles": {
"data": []
},
"uni-id-permissions": {
"data": []
},
"uni-id-log": {
"data": []
},
"opendb-admin-menus": {
"data": [{
"menu_id": "system_management",
"name": "系统管理",
"icon": "uni-icons-gear",
"url": "",
"sort": 1000,
"parent_id": "",
"permission": [],
"enable": true,
"create_date": 1602662469396
}, {
"menu_id": "system_user",
"name": "用户管理",
"icon": "uni-icons-person",
"url": "/pages/system/user/list",
"sort": 1010,
"parent_id": "system_management",
"permission": [],
"enable": true,
"create_date": 1602662469398
}, {
"menu_id": "system_role",
"name": "角色管理",
"icon": "uni-icons-personadd",
"url": "/pages/system/role/list",
"sort": 1020,
"parent_id": "system_management",
"permission": [],
"enable": true,
"create_date": 1602662469397
}, {
"menu_id": "system_permission",
"name": "权限管理",
"icon": "uni-icons-locked",
"url": "/pages/system/permission/list",
"sort": 1030,
"parent_id": "system_management",
"permission": [],
"enable": true,
"create_date": 1602662469396
}, {
"menu_id": "system_menu",
"name": "菜单管理",
"icon": "uni-icons-settings",
"url": "/pages/system/menu/list",
"sort": 1040,
"parent_id": "system_management",
"permission": [],
"enable": true,
"create_date": 1602662469396
}]
},
"opendb-news-articles": {
"data": [{
"title": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务",
......
{
"bsonType": "object",
"required": ["name", "menu_id"],
"permission": {
"read": true
},
"properties": {
"_id": {
"description": "存储文档 ID,系统自动生成"
......
{
"bsonType": "object",
"required": [],
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"code": {
"bsonType": "string",
"description": "验证码"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间"
},
"device_uuid": {
"mobile": {
"bsonType": "string",
"description": "设备UUID,常用于图片验证码"
"description": "手机号码"
},
"email": {
"bsonType": "string",
"description": "邮箱"
},
"expired_date": {
"bsonType": "timestamp",
"description": "过期时间"
},
"ip": {
"device_uuid": {
"bsonType": "string",
"description": "请求时客户端IP地址"
"description": "设备UUID,常用于图片验证码"
},
"mobile": {
"code": {
"bsonType": "string",
"description": "手机号码"
"description": "验证码"
},
"scene": {
"bsonType": "string",
......@@ -39,7 +28,18 @@
"state": {
"bsonType": "int",
"description": "验证状态:0 未验证、1 已验证、2 已作废"
}
},
"required": []
"ip": {
"bsonType": "string",
"description": "请求时客户端IP地址"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间"
},
"expired_date": {
"bsonType": "timestamp",
"description": "过期时间"
}
}
}
\ No newline at end of file
{
"bsonType": "object",
"required": ["user_id"],
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
"user_id": {
"bsonType": "string",
"description": "用户id,参考uni-id-users表"
},
"ua": {
"bsonType": "string",
"description": "userAgent"
},
"device_uuid": {
"bsonType": "string",
"description": "设备唯一标识"
"description": "设备唯一标识(需要加密存储)"
},
"ip": {
"type": {
"bsonType": "string",
"description": "ip地址"
"enum": ["login", "logout"],
"description": "登录类型"
},
"state": {
"bsonType": "int",
"description": "结果:0 失败、1 成功"
},
"type": {
"bsonType": "string",
"description": "登录类型",
"enum": ["login", "logout"]
},
"ua": {
"ip": {
"bsonType": "string",
"description": "userAgent"
"description": "ip地址"
},
"user_id": {
"bsonType": "string",
"description": "用户id,参考uni-id-users表"
"create_date": {
"bsonType": "timestamp",
"description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
}
}
},
"required": []
}
{
"bsonType": "object",
"permission": {
"read": true,
"create": false,
"update": "doc._id == auth.uid",
"delete": false
},
"required": [],
"properties": {
"_id": {
"description": "存储文档 ID(用户 ID),系统自动生成"
},
"ali_openid": {
"bsonType": "string",
"description": "支付宝平台openid"
},
"apple_openid": {
"bsonType": "string",
"description": "苹果登录openid"
},
"avatar": {
"username": {
"bsonType": "string",
"description": "头像地址",
"title": "头像地址",
"title": "用户名",
"description": "用户名,不允许重复",
"trim": "both"
},
"avatar_file": {
"bsonType": "file",
"title": "头像文件",
"description": "用file类型方便使用uni-file-picker组件"
},
"comment": {
"bsonType": "string",
"description": "备注",
"title": "备注",
"password": {
"bsonType": "password",
"title": "密码",
"description": "密码,加密存储",
"trim": "both"
},
"department_id": {
"bsonType": "array",
"description": "部门ID",
"enum": {
"collection": "opendb-department",
"field": "_id as value, name as text",
"orderby": "name asc"
},
"enumType": "tree",
"title": "部门"
"password_secret_version": {
"bsonType": "int",
"title": "passwordSecret",
"description": "密码使用的passwordSecret版本"
},
"email": {
"nickname": {
"bsonType": "string",
"description": "邮箱地址",
"format": "email",
"title": "邮箱",
"title": "昵称",
"description": "用户昵称",
"trim": "both"
},
"email_confirmed": {
"bsonType": "int",
"defaultValue": 0,
"description": "邮箱验证状态:0 未验证 1 已验证",
"enum": [{
"text": "未验证",
"value": 0
}, {
"text": "已验证",
"value": 1
}],
"title": "邮箱验证状态"
},
"gender": {
"bsonType": "int",
"defaultValue": 0,
"title": "性别",
"description": "用户性别:0 未知 1 男性 2 女性",
"enum": [{
"defaultValue": 0,
"enum": [
{
"text": "未知",
"value": 0
}, {
},
{
"text": "男",
"value": 1
}, {
},
{
"text": "女",
"value": 2
}],
"title": "性别"
}
]
},
"inviter_uid": {
"bsonType": "array",
"description": "用户全部上级邀请者",
"trim": "both"
"status": {
"bsonType": "int",
"description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝",
"title": "用户状态",
"defaultValue": 0,
"enum": [
{
"text": "正常",
"value": 0
},
"last_login_date": {
"bsonType": "timestamp",
"description": "最后登录时间"
{
"text": "禁用",
"value": 1
},
"last_login_ip": {
"bsonType": "string",
"description": "最后登录时 IP 地址"
{
"text": "审核中",
"value": 2
},
{
"text": "审核拒绝",
"value": 3
}
]
},
"mobile": {
"bsonType": "string",
"title": "手机号码",
"description": "手机号码",
"pattern": "^\\+?[0-9-]{3,20}$",
"title": "手机号码",
"trim": "both"
},
"mobile_confirmed": {
"bsonType": "int",
"defaultValue": 0,
"description": "手机号验证状态:0 未验证 1 已验证",
"enum": [{
"title": "手机号验证状态",
"defaultValue": 0,
"enum": [
{
"text": "未验证",
"value": 0
}, {
},
{
"text": "已验证",
"value": 1
}],
"title": "手机号验证状态"
}
]
},
"my_invite_code": {
"email": {
"bsonType": "string",
"description": "用户自身邀请码"
"format": "email",
"title": "邮箱",
"description": "邮箱地址",
"trim": "both"
},
"nickname": {
"email_confirmed": {
"bsonType": "int",
"description": "邮箱验证状态:0 未验证 1 已验证",
"title": "邮箱验证状态",
"defaultValue": 0,
"enum": [
{
"text": "未验证",
"value": 0
},
{
"text": "已验证",
"value": 1
}
]
},
"avatar": {
"bsonType": "string",
"description": "用户昵称",
"title": "昵称",
"title": "头像地址",
"description": "头像地址",
"trim": "both"
},
"password": {
"bsonType": "password",
"description": "密码,加密存储",
"title": "密码",
"trim": "both"
"avatar_file": {
"bsonType": "file",
"title": "头像文件",
"description": "用file类型方便使用uni-file-picker组件"
},
"password_secret_version": {
"bsonType": "int",
"description": "密码使用的passwordSecret版本",
"title": "passwordSecret"
"department_id": {
"bsonType": "array",
"description": "部门ID",
"title": "部门",
"enumType": "tree",
"enum": {
"collection": "opendb-department",
"orderby": "name asc",
"field": "_id as value, name as text"
}
},
"role": {
"bsonType": "array",
"title": "角色",
"description": "用户角色",
"enum": {
"collection": "uni-id-roles",
"field": "role_id as value, role_name as text"
},
"foreignKey": "uni-id-roles.role_id",
"permission": {
"write": false
}
},
"wx_unionid": {
"bsonType": "string",
"description": "微信unionid"
},
"wx_openid": {
"bsonType": "object",
"description": "微信各个平台openid",
"properties": {
"app-plus": {
"bsonType": "string",
"description": "app平台微信openid"
},
"mp-weixin": {
"bsonType": "string",
"description": "微信小程序平台openid"
}
}
},
"ali_openid": {
"bsonType": "string",
"description": "支付宝平台openid"
},
"apple_openid": {
"bsonType": "string",
"description": "苹果登录openid"
},
"comment": {
"bsonType": "string",
"title": "备注",
"description": "备注",
"trim": "both"
},
"realname_auth": {
"bsonType": "object",
"description": "实名认证信息",
"required": [
"type",
"auth_status"
],
"properties": {
"auth_date": {
"bsonType": "timestamp",
"description": "认证通过时间"
"type": {
"bsonType": "int",
"minimum": 0,
"maximum": 1,
"description": "用户类型:0 个人用户 1 企业用户"
},
"auth_status": {
"bsonType": "int",
"description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败",
"minimum": 0,
"maximum": 3,
"minimum": 0
},
"contact_email": {
"bsonType": "string",
"description": "联系人邮箱"
"description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败"
},
"contact_mobile": {
"bsonType": "string",
"description": "联系人手机号码"
"auth_date": {
"bsonType": "timestamp",
"description": "认证通过时间"
},
"contact_person": {
"real_name": {
"bsonType": "string",
"description": "联系人姓名"
"description": "真实姓名/企业名称"
},
"id_card_back": {
"identity": {
"bsonType": "string",
"description": "身份证反面照 URL"
"description": "身份证号码/营业执照号码"
},
"id_card_front": {
"bsonType": "string",
"description": "身份证正面照 URL"
},
"identity": {
"id_card_back": {
"bsonType": "string",
"description": "身份证号码\/营业执照号码"
"description": "身份证反面照 URL"
},
"in_hand": {
"bsonType": "string",
......@@ -182,18 +233,23 @@
"bsonType": "string",
"description": "营业执照 URL"
},
"real_name": {
"contact_person": {
"bsonType": "string",
"description": "真实姓名\/企业名称"
"description": "联系人姓名"
},
"type": {
"bsonType": "int",
"description": "用户类型:0 个人用户 1 企业用户",
"maximum": 1,
"minimum": 0
"contact_mobile": {
"bsonType": "string",
"description": "联系人手机号码"
},
"contact_email": {
"bsonType": "string",
"description": "联系人邮箱"
}
}
},
"required": ["type", "auth_status"]
"score": {
"bsonType": "int",
"description": "用户积分,积分变更记录可参考:uni-id-scores表定义"
},
"register_date": {
"bsonType": "timestamp",
......@@ -209,66 +265,30 @@
"$env": "clientIP"
}
},
"role": {
"bsonType": "array",
"description": "用户角色",
"enum": {
"collection": "uni-id-roles",
"field": "role_id as value, role_name as text"
},
"foreignKey": "uni-id-roles.role_id",
"permission": {
"write": false
},
"title": "角色"
"last_login_date": {
"bsonType": "timestamp",
"description": "最后登录时间"
},
"status": {
"bsonType": "int",
"defaultValue": 0,
"description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝",
"enum": [{
"text": "正常",
"value": 0
}, {
"text": "禁用",
"value": 1
}, {
"text": "审核中",
"value": 2
}, {
"text": "审核拒绝",
"value": 3
}],
"title": "用户状态"
"last_login_ip": {
"bsonType": "string",
"description": "最后登录时 IP 地址"
},
"token": {
"bsonType": "array",
"description": "用户token"
},
"username": {
"bsonType": "string",
"description": "用户名,不允许重复",
"title": "用户名",
"inviter_uid": {
"bsonType": "array",
"description": "用户全部上级邀请者",
"trim": "both"
},
"wx_openid": {
"bsonType": "object",
"description": "微信各个平台openid",
"properties": {
"app-plus": {
"bsonType": "string",
"description": "app平台微信openid"
"invite_time": {
"bsonType": "timestamp",
"description": "受邀时间"
},
"mp-weixin": {
"my_invite_code": {
"bsonType": "string",
"description": "微信小程序平台openid"
}
"description": "用户自身邀请码"
}
},
"wx_unionid": {
"bsonType": "string",
"description": "微信unionid"
}
},
"required": []
}
\ No newline at end of file
{
"name" : "uni-starter",
"appid" : "__UNI__E5373F7",
"description" : "云端一体应用快速开发模版",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意",
"buttonRefuse" : "暂不同意"
"name": "uni-starter",
"appid": "__UNI__E5373F7",
"description": "云端一体应用快速开发模版",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
"privacy": {
"prompt": "template",
"template": {
"title": "服务协议和隐私政策",
"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "同意",
"buttonRefuse": "暂不同意"
}
},
"compatible" : {
"ignoreVersion" : true
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {
"Fingerprint" : {},
"Share" : {},
"OAuth" : {},
"FaceID" : {}
},
"distribute" : {
"android" : {
"permissions" : [
"compatible": {
"ignoreVersion": true
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {
"Fingerprint": {
},
"Share": {
},
"OAuth": {
},
"FaceID": {
}
},
"distribute": {
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
......@@ -54,57 +58,68 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {},
"sdkConfigs" : {
"oauth" : {
"apple" : {},
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"appsecret" : "",
"UniversalLinks" : ""
"abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86"
]
},
"ios": {
},
"sdkConfigs": {
"oauth": {
"apple": {
},
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"appsecret": "",
"UniversalLinks": ""
}
},
"ad" : {},
"share" : {
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"UniversalLinks" : ""
"ad": {
},
"share": {
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"UniversalLinks": ""
}
},
"geolocation" : {},
"push" : {
"unipush" : {}
"geolocation": {
},
"push": {
"unipush": {
}
},
"payment" : {}
"payment": {
}
}
},
"nvueLaunchMode" : ""
"nvueLaunchMode": ""
},
"quickapp": {
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false,
"es6" : false
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": false
},
"usingComponents" : true,
"betterScopedSlots" : true
"usingComponents": true,
"betterScopedSlots": true
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": false
},
"h5" : {
"template" : ""
"h5": {
"template": ""
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册