Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦想橡皮擦
uni-starter
提交
d1fac9bb
U
uni-starter
项目概览
梦想橡皮擦
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d1fac9bb
编写于
9月 19, 2022
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 更新表结构,解决部分clientDB操作没有权限的问题
上级
c5f712ab
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
209 addition
and
518 deletion
+209
-518
README.md
README.md
+1
-347
changelog.md
changelog.md
+2
-0
manifest.json
manifest.json
+64
-60
package.json
package.json
+1
-1
uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json
...s/uni-id-pages/uniCloud/database/uni-id-users.schema.json
+55
-27
uni_modules_tools/change_after.js
uni_modules_tools/change_after.js
+2
-3
uni_modules_tools/main.js
uni_modules_tools/main.js
+84
-80
未找到文件。
README.md
浏览文件 @
d1fac9bb
此差异已折叠。
点击以展开。
changelog.md
浏览文件 @
d1fac9bb
## 2.0.2(2022-09-19)
-
更新表结构,解决部分clientDB操作没有权限的问题
## 2.0.1(2022-09-16)
-
更改默认值
## 2.0.0(2022-09-16)
...
...
manifest.json
浏览文件 @
d1fac9bb
{
"name"
:
"uni-starter"
,
"appid"
:
"__UNI__07F7150"
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"app-plus"
:
{
"usingComponents"
:
true
,
"nvueStyleCompiler"
:
"uni-app"
,
"compilerVersion"
:
3
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
true
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
"modules"
:
{},
"distribute"
:
{
"android"
:
{
"permissions"
:
[
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
]
},
"ios"
:
{},
"sdkConfigs"
:
{}
}
"name"
:
""
,
"appid"
:
""
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"versionName"
:
""
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"app-plus"
:
{
"usingComponents"
:
true
,
"nvueStyleCompiler"
:
"uni-app"
,
"compilerVersion"
:
3
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
true
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
"quickapp"
:
{},
"mp-weixin"
:
{
"appid"
:
""
,
"setting"
:
{
"urlCheck"
:
false
},
"usingComponents"
:
true
"modules"
:
{
},
"mp-alipay"
:
{
"usingComponents"
:
true
"distribute"
:
{
"android"
:
{
"permissions"
:
[
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
]
},
"ios"
:
{
},
"sdkConfigs"
:
{
}
}
},
"quickapp"
:
{
},
"mp-weixin"
:
{
"appid"
:
""
,
"setting"
:
{
"urlCheck"
:
false
},
"mp-baidu"
:
{
"usingComponents"
:
true
},
"mp-toutiao"
:
{
"usingComponents"
:
true
},
"uniStatistics"
:
{
"enable"
:
false
},
"vueVersion"
:
"2"
}
"usingComponents"
:
true
},
"mp-alipay"
:
{
"usingComponents"
:
true
},
"mp-baidu"
:
{
"usingComponents"
:
true
},
"mp-toutiao"
:
{
"usingComponents"
:
true
},
"uniStatistics"
:
{
"enable"
:
false
},
"vueVersion"
:
"2"
}
\ No newline at end of file
package.json
浏览文件 @
d1fac9bb
{
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"2.0.
1
"
,
"version"
:
"2.0.
2
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"login"
,
...
...
uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json
浏览文件 @
d1fac9bb
...
...
@@ -2,7 +2,7 @@
"bsonType"
:
"object"
,
"permission"
:
{
"update"
:
"doc._id == auth.uid"
,
"read"
:
"doc._id == auth.uid"
"read"
:
true
},
"properties"
:
{
"_id"
:
{
...
...
@@ -12,14 +12,16 @@
"bsonType"
:
"string"
,
"description"
:
"支付宝平台openid"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"apple_openid"
:
{
"bsonType"
:
"string"
,
"description"
:
"苹果登录openid"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"avatar"
:
{
...
...
@@ -39,7 +41,8 @@
"title"
:
"备注"
,
"trim"
:
"both"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
false
}
},
"dcloud_appid"
:
{
...
...
@@ -47,7 +50,8 @@
"description"
:
"允许登录的客户端的appid列表"
,
"foreignKey"
:
"opendb-app-list.appid"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"department_id"
:
{
...
...
@@ -61,7 +65,8 @@
"enumType"
:
"tree"
,
"title"
:
"部门"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"email"
:
{
...
...
@@ -71,7 +76,8 @@
"title"
:
"邮箱"
,
"trim"
:
"both"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"email_confirmed"
:
{
...
...
@@ -89,7 +95,8 @@
],
"title"
:
"邮箱验证状态"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"gender"
:
{
...
...
@@ -111,14 +118,16 @@
],
"title"
:
"性别"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"invite_time"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"受邀时间"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"inviter_uid"
:
{
...
...
@@ -126,21 +135,24 @@
"description"
:
"用户全部上级邀请者"
,
"trim"
:
"both"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"last_login_date"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"最后登录时间"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"last_login_ip"
:
{
"bsonType"
:
"string"
,
"description"
:
"最后登录时 IP 地址"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"mobile"
:
{
...
...
@@ -150,7 +162,8 @@
"title"
:
"手机号码"
,
"trim"
:
"both"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"mobile_confirmed"
:
{
...
...
@@ -168,14 +181,16 @@
],
"title"
:
"手机号验证状态"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"my_invite_code"
:
{
"bsonType"
:
"string"
,
"description"
:
"用户自身邀请码"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"nickname"
:
{
...
...
@@ -207,7 +222,8 @@
"bsonType"
:
"object"
,
"description"
:
"实名认证信息"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
},
"properties"
:
{
"auth_date"
:
{
...
...
@@ -272,14 +288,16 @@
"bsonType"
:
"timestamp"
,
"description"
:
"注册时间"
,
"forceDefaultValue"
:
{
"$env"
:
"now"
"$env"
:
"now"
,
"read"
:
"doc._id == auth.uid"
}
},
"register_ip"
:
{
"bsonType"
:
"string"
,
"description"
:
"注册时 IP 地址"
,
"forceDefaultValue"
:
{
"$env"
:
"clientIP"
"$env"
:
"clientIP"
,
"read"
:
"doc._id == auth.uid"
}
},
"role"
:
{
...
...
@@ -291,7 +309,8 @@
},
"foreignKey"
:
"uni-id-roles.role_id"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
},
"title"
:
"角色"
},
...
...
@@ -299,7 +318,8 @@
"bsonType"
:
"int"
,
"description"
:
"用户积分,积分变更记录可参考:uni-id-scores表定义"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"status"
:
{
...
...
@@ -307,7 +327,8 @@
"defaultValue"
:
0
,
"description"
:
"用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
},
"enum"
:
[{
"text"
:
"正常"
,
...
...
@@ -330,7 +351,10 @@
},
"token"
:
{
"bsonType"
:
"array"
,
"description"
:
"用户token"
"description"
:
"用户token"
,
"permission"
:
{
"read"
:
"doc._id == auth.uid"
}
},
"username"
:
{
"bsonType"
:
"string"
,
...
...
@@ -363,14 +387,16 @@
}
},
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"wx_unionid"
:
{
"bsonType"
:
"string"
,
"description"
:
"微信unionid"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"qq_openid"
:
{
...
...
@@ -387,14 +413,16 @@
}
},
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
},
"qq_unionid"
:
{
"bsonType"
:
"string"
,
"description"
:
"QQ unionid"
,
"permission"
:
{
"write"
:
false
"write"
:
false
,
"read"
:
"doc._id == auth.uid"
}
}
},
...
...
uni_modules_tools/change_after.js
浏览文件 @
d1fac9bb
const
fs
=
require
(
'
fs
'
);
module
.
exports
=
function
(){
console
.
log
(
'
开始执行脚本change_after
'
);
/*
let changelog = fs.readFileSync(process.cwd() + '/changelog.md', 'utf-8').split("##")[1].split("\n").slice(1).join(' ');
let
changelog
=
fs
.
readFileSync
(
process
.
cwd
()
+
'
/changelog.md
'
,
'
utf-8
'
).
split
(
"
##
"
)[
1
].
split
(
"
\n
"
).
slice
(
1
).
join
(
'
'
);
console
.
log
(
changelog
);
// 这里是修改完相关敏感配置后执行的脚本,你可以在这里自定义逻辑,
// 比如执行git提交命令
var
shell
=
require
(
"
shelljs
"
);
var
exec
=
shell
.
exec
;
...
...
@@ -23,5 +22,5 @@ module.exports = function(){
shell
.
exit
(
1
);
}
shell
.
exec
(
`echo git success
${
changelog
}
`
);
*/
}
\ No newline at end of file
uni_modules_tools/main.js
浏览文件 @
d1fac9bb
//脚本文件目录 __dirname
//运行脚本的目录,即:项目的目录 process.cwd()
//配置文件
//配置文件
const
fs
=
require
(
'
fs
'
),
Hjson
=
require
(
'
hjson
'
),
config
=
Hjson
.
rt
.
parse
(
fs
.
readFileSync
(
__dirname
+
'
/config.js
'
,
'
utf-8
'
))
const
change_after
=
require
(
'
./change_after
'
)
if
(
process
.
argv
[
2
]
==
'
change
'
){
change
(
config
,
()
=>
{
console
.
log
(
'
脚本change已经执行成功
'
);
change_after
()
})
}
else
{
recovery
(
config
)
}
function
change
(
config
,
callback
){
const
total
=
Object
.
keys
(
config
).
length
let
index
=
0
;
for
(
let
fileName
in
config
)
{
let
path
=
process
.
cwd
()
+
fileName
let
copyPath
=
__dirname
+
'
/copy
'
+
fileName
let
fileText
=
fs
.
readFileSync
(
path
,
'
utf-8
'
)
//保持原文件名先备份一份到/uni_modules_tools/copy目录下,然后再覆盖
writeFileRecursive
(
copyPath
,
fileText
,
function
(
err
)
{
//创建目录并写入文件
if
(
err
)
{
return
console
.
log
(
err
);
}
//改写
let
HfileObj
=
Hjson
.
rt
.
parse
(
fileText
)
//递归合并,为了保留注释内容
mergeJSON
(
HfileObj
,
config
[
fileName
])
fs
.
writeFile
(
path
,
Hjson
.
rt
.
stringify
(
HfileObj
,
{
quotes
:
'
all
'
,
separator
:
true
,
multiline
:
"
off
"
,
bracesSameLine
:
true
}),
function
(
err
)
{
if
(
err
)
{
return
console
.
log
(
err
);
}
index
++
if
(
index
==
total
){
callback
()
}
})
})
}
}
function
recovery
()
{
let
paths
=
Object
.
keys
(
config
)
console
.
log
(
paths
);
paths
.
forEach
(
path
=>
{
console
.
log
(
__dirname
+
'
/copy
'
+
path
);
let
oldFile
=
fs
.
readFileSync
(
__dirname
+
'
/copy
'
+
path
)
console
.
log
(
process
.
cwd
()
+
path
);
fs
.
writeFile
(
process
.
cwd
()
+
path
,
oldFile
,
function
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
return
}
// fs.unlinkSync(__dirname + path+'.lock')
})
})
}
Hjson
=
require
(
'
hjson
'
),
config
=
Hjson
.
rt
.
parse
(
fs
.
readFileSync
(
__dirname
+
'
/config.js
'
,
'
utf-8
'
))
const
change_after
=
require
(
'
./change_after
'
)
if
(
process
.
argv
[
2
]
==
'
change
'
)
{
change
(
config
,
()
=>
{
console
.
log
(
'
脚本change已经执行成功
'
);
change_after
()
})
}
else
{
recovery
(
config
)
}
function
change
(
config
,
callback
)
{
const
total
=
Object
.
keys
(
config
).
length
let
index
=
0
;
for
(
let
fileName
in
config
)
{
let
path
=
process
.
cwd
()
+
fileName
let
copyPath
=
__dirname
+
'
/copy
'
+
fileName
let
fileText
=
fs
.
readFileSync
(
path
,
'
utf-8
'
)
//保持原文件名先备份一份到/uni_modules_tools/copy目录下,然后再覆盖
writeFileRecursive
(
copyPath
,
fileText
,
function
(
err
)
{
//创建目录并写入文件
if
(
err
)
{
return
console
.
log
(
err
);
}
//改写
let
HfileObj
=
Hjson
.
rt
.
parse
(
fileText
)
//递归合并,为了保留注释内容
mergeJSON
(
HfileObj
,
config
[
fileName
])
fs
.
writeFile
(
path
,
Hjson
.
rt
.
stringify
(
HfileObj
,
{
quotes
:
'
all
'
,
separator
:
true
,
multiline
:
"
off
"
,
bracesSameLine
:
true
}),
function
(
err
)
{
if
(
err
)
{
return
console
.
log
(
err
);
}
index
++
if
(
index
==
total
)
{
callback
()
}
})
})
}
}
function
recovery
()
{
let
paths
=
Object
.
keys
(
config
)
console
.
log
(
paths
);
paths
.
forEach
(
path
=>
{
console
.
log
(
__dirname
+
'
/copy
'
+
path
);
let
oldFile
=
fs
.
readFileSync
(
__dirname
+
'
/copy
'
+
path
)
console
.
log
(
process
.
cwd
()
+
path
);
fs
.
writeFile
(
process
.
cwd
()
+
path
,
oldFile
,
function
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
return
}
// fs.unlinkSync(__dirname + path+'.lock')
})
})
}
//创建目录并写入文件
function
writeFileRecursive
(
path
,
buffer
,
callback
)
{
...
...
@@ -93,11 +93,15 @@ function writeFileRecursive(path, buffer, callback) {
//递归合并,为了保留注释内容
function
mergeJSON
(
minor
,
main
)
{
for
(
var
key
in
main
)
{
if
(
typeof
(
main
[
key
])
!=
'
object
'
)
{
minor
[
key
]
=
main
[
key
];
}
else
{
console
.
log
(
'
[
'
,
minor
[
key
],
main
[
key
],
'
]
'
);
mergeJSON
(
minor
[
key
],
main
[
key
]);
if
(
typeof
(
main
[
key
])
!=
'
object
'
)
{
minor
[
key
]
=
main
[
key
];
}
else
{
if
(
minor
&&
main
){
console
.
log
(
'
[
'
,
minor
[
key
],
main
[
key
],
'
]
'
);
mergeJSON
(
minor
[
key
],
main
[
key
]);
}
else
{
console
.
log
({
minor
,
main
});
}
}
}
}
\ No newline at end of file
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录