Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vk-uni
vk-unicloud-admin
提交
2afbac06
vk-unicloud-admin
项目概览
vk-uni
/
vk-unicloud-admin
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
vk-unicloud-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2afbac06
编写于
9月 01, 2021
作者:
VK1688
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.5.10
上级
7165b324
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
118 addition
and
69 deletion
+118
-69
README/1.5/1.5.10.md
README/1.5/1.5.10.md
+9
-0
changelog.md
changelog.md
+11
-0
package.json
package.json
+1
-1
pages_plugs/system_uni/uni-id-files/list.vue
pages_plugs/system_uni/uni-id-files/list.vue
+3
-1
uni_modules/vk-unicloud/changelog.md
uni_modules/vk-unicloud/changelog.md
+3
-0
uni_modules/vk-unicloud/package.json
uni_modules/vk-unicloud/package.json
+1
-1
uni_modules/vk-unicloud/vk_modules/vk-unicloud-page/libs/function/aliyunOSSUtil.js
...k_modules/vk-unicloud-page/libs/function/aliyunOSSUtil.js
+78
-63
uni_modules/vk-unicloud/vk_modules/vk-unicloud-page/libs/vk-unicloud/vk-unicloud-callFunctionUtil.js
...oud-page/libs/vk-unicloud/vk-unicloud-callFunctionUtil.js
+12
-3
未找到文件。
README/1.5/1.5.10.md
0 → 100644
浏览文件 @
2afbac06
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
*
【修复】
`素材管理`
上传图片后有概率无法及时回显的bug。(需同时更新uni_modules/vk-unicloud)
[
点击查看
](
https://vkdoc.fsq.pub/admin/components/25%E3%80%81file-select.html
)
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
#### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
changelog.md
浏览文件 @
2afbac06
## 1.5.10(2021-09-01)
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
*
【修复】
`素材管理`
上传图片后有概率无法及时回显的bug。(需同时更新uni_modules/vk-unicloud)
[
点击查看
](
https://vkdoc.fsq.pub/admin/components/25%E3%80%81file-select.html
)
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
#### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
## 1.5.9(2021-09-01)
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
...
...
package.json
浏览文件 @
2afbac06
{
"id"
:
"vk-unicloud-admin"
,
"name"
:
"vk-unicloud-admin"
,
"version"
:
"1.5.
9
"
,
"version"
:
"1.5.
10
"
,
"displayName"
:
"【开箱即用】vk-unicloud-admin - 快速开发框架 - 几分钟即可完成一个页面CRUD"
,
"description"
:
"vk-unicloud-admin是基于unicloud+uni-id+element+vk-unicloud-router的一套快速PC admin完整开发框架。丰富的API可以让你开发事半功倍。"
,
"keywords"
:
[
...
...
pages_plugs/system_uni/uni-id-files/list.vue
浏览文件 @
2afbac06
...
...
@@ -294,11 +294,11 @@ export default {
uni
.
chooseFile
({
extension
,
success
:
res
=>
{
vk
.
showLoading
(
"
上传中...
"
);
let
tasks
=
[];
for
(
let
i
in
res
.
tempFilePaths
)
{
tasks
.
push
(
vk
.
callFunctionUtil
.
uploadFile
({
title
:
"
上传中...
"
,
filePath
:
res
.
tempFilePaths
[
i
],
file
:
res
.
tempFiles
[
i
],
needSave
:
true
,
...
...
@@ -309,9 +309,11 @@ export default {
}
Promise
.
all
(
tasks
)
.
then
(
res1
=>
{
vk
.
hideLoading
();
that
.
getList
();
})
.
catch
(
err
=>
{
vk
.
hideLoading
();
console
.
error
(
err
);
});
}
...
...
uni_modules/vk-unicloud/changelog.md
浏览文件 @
2afbac06
## 2.3.22(2021-09-01)
*
1、【优化】文件上传逻辑
*
完整框架项目地址:
`https://ext.dcloud.net.cn/plugin?id=2204`
[
点击查看
](
https://ext.dcloud.net.cn/plugin?id=2204
)
## 2.3.21(2021-08-31)
*
1、【新增】配置
`vk.db.unicloud.getTableData.sortArr`
,可以设置
`vk.baseDao.getTableData`
全局默认排序规则
*
2、【优化】一些细节
...
...
uni_modules/vk-unicloud/package.json
浏览文件 @
2afbac06
{
"id"
:
"vk-unicloud"
,
"displayName"
:
"vk-unicloud-router开发框架核心库 - 已集成uni-id 框架内置了众多API。"
,
"version"
:
"2.3.2
1
"
,
"version"
:
"2.3.2
2
"
,
"description"
:
"此为vk-unicloud-router框架核心库(新手建议下载完整框架项目)已集成uni-id支持云函数url化。众多现成API,内置小白也能轻松上手的数据库API。使你项目刚起步进度就是百分之50"
,
"keywords"
:
[
"vk-unicloud-router"
,
...
...
uni_modules/vk-unicloud/vk_modules/vk-unicloud-page/libs/function/aliyunOSSUtil.js
浏览文件 @
2afbac06
...
...
@@ -41,9 +41,11 @@ aliyunOSSUtil.uploadFile = function(obj) {
index
=
0
,
file
=
{},
needSave
=
false
,
category_id
category_id
,
title
,
}
=
obj
;
let
vk
=
getApp
().
globalData
.
vk
;
if
(
title
)
vk
.
showLoading
(
title
);
let
fileNameObj
=
createFileName
(
obj
);
let
aliyunOSS
=
getConfig
();
let
fileName
=
fileNameObj
.
fileFullName
;
...
...
@@ -62,73 +64,86 @@ aliyunOSSUtil.uploadFile = function(obj) {
let
Logger
=
{};
Logger
.
startTime
=
new
Date
().
getTime
();
Logger
.
filePath
=
filePath
;
let
uploadTask
=
uni
.
uploadFile
({
url
:
aliyunOSS
.
action
,
filePath
,
name
,
header
,
formData
:
formData
,
success
:
function
(
res
)
{
if
(
!
[
200
,
201
].
includes
(
res
.
statusCode
))
{
if
(
typeof
obj
.
fail
===
"
function
"
)
obj
.
fail
(
res
);
return
new
Promise
((
resolve
,
reject
)
=>
{
let
uploadTask
=
uni
.
uploadFile
({
url
:
aliyunOSS
.
action
,
filePath
,
name
,
header
,
formData
:
formData
,
success
:
function
(
res
)
{
if
(
title
)
vk
.
hideLoading
();
if
(
!
[
200
,
201
].
includes
(
res
.
statusCode
))
{
if
(
typeof
obj
.
fail
===
"
function
"
)
obj
.
fail
(
res
);
Logger
.
error
=
res
;
}
else
{
// 上传成功
res
.
fileID
=
fileNameObj
.
url
;
Logger
.
result
=
res
;
if
(
needSave
)
{
// 保存文件记录到数据库
vk
.
userCenter
.
addUploadRecord
({
data
:
{
url
:
res
.
fileID
,
name
:
file
.
name
,
size
:
file
.
size
,
file_id
:
res
.
fileID
,
provider
:
"
aliyun
"
,
category_id
},
filePath
,
fileType
,
success
:
function
()
{
if
(
typeof
obj
.
success
===
"
function
"
)
obj
.
success
(
res
);
resolve
(
res
);
},
fail
:
function
(
res
)
{
if
(
typeof
obj
.
fail
===
"
function
"
)
obj
.
fail
(
res
);
reject
(
res
);
}
});
}
else
{
if
(
typeof
obj
.
success
===
"
function
"
)
obj
.
success
(
res
);
resolve
(
res
);
}
}
},
fail
:
function
(
res
)
{
if
(
title
)
vk
.
hideLoading
();
Logger
.
error
=
res
;
}
else
{
// 上传成功
res
.
fileID
=
fileNameObj
.
url
;
if
(
typeof
obj
.
success
===
"
function
"
)
obj
.
success
(
res
);
Logger
.
result
=
res
;
if
(
needSave
)
{
// 保存文件记录到数据库
vk
.
userCenter
.
addUploadRecord
({
data
:
{
url
:
res
.
fileID
,
name
:
file
.
name
,
size
:
file
.
size
,
file_id
:
res
.
fileID
,
provider
:
"
aliyun
"
,
category_id
},
filePath
,
fileType
});
if
(
res
.
errMsg
&&
res
.
errMsg
.
indexOf
(
'
fail url not in domain list
'
)
>-
1
){
vk
.
toast
(
'
上传域名未在白名单中
'
);
}
if
(
typeof
obj
.
fail
===
"
function
"
)
obj
.
fail
(
res
);
},
complete
:
function
()
{
let
vk
=
getApp
().
globalData
.
vk
;
let
config
=
vk
.
callFunctionUtil
.
config
;
if
(
config
.
debug
)
{
Logger
.
endTime
=
new
Date
().
getTime
();
Logger
.
runTime
=
(
Logger
.
endTime
-
Logger
.
startTime
);
let
colorArr
=
config
.
logger
.
colorArr
;
let
colorStr
=
colorArr
[
counterNum
%
colorArr
.
length
];
counterNum
++
;
console
.
log
(
"
%c--------【开始】【阿里云oss文件上传】--------
"
,
'
color:
'
+
colorStr
+
'
;font-size: 12px;font-weight: bold;
'
);
console
.
log
(
"
【本地文件】:
"
,
Logger
.
filePath
);
console
.
log
(
"
【返回数据】:
"
,
Logger
.
result
);
console
.
log
(
"
【预览地址】:
"
,
Logger
.
result
.
fileID
);
console
.
log
(
"
【上传耗时】:
"
,
Logger
.
runTime
,
"
毫秒
"
);
console
.
log
(
"
【上传时间】:
"
,
vk
.
pubfn
.
timeFormat
(
Logger
.
startTime
,
"
yyyy-MM-dd hh:mm:ss
"
));
if
(
Logger
.
error
)
console
.
error
(
"
【error】:
"
,
Logger
.
error
);
console
.
log
(
"
%c--------【结束】【阿里云oss文件上传】--------
"
,
'
color:
'
+
colorStr
+
'
;font-size: 12px;font-weight: bold;
'
);
}
}
},
fail
:
function
(
res
)
{
Logger
.
error
=
res
;
if
(
res
.
errMsg
&&
res
.
errMsg
.
indexOf
(
'
fail url not in domain list
'
)
>-
1
){
vk
.
toast
(
'
上传域名未在白名单中
'
);
}
if
(
typeof
obj
.
fail
===
"
function
"
)
obj
.
fail
(
res
);
},
complete
:
function
()
{
let
vk
=
getApp
().
globalData
.
vk
;
let
config
=
vk
.
callFunctionUtil
.
config
;
if
(
config
.
debug
)
{
Logger
.
endTime
=
new
Date
().
getTime
();
Logger
.
runTime
=
(
Logger
.
endTime
-
Logger
.
startTime
);
let
colorArr
=
config
.
logger
.
colorArr
;
let
colorStr
=
colorArr
[
counterNum
%
colorArr
.
length
];
counterNum
++
;
console
.
log
(
"
%c--------【开始】【阿里云oss文件上传】--------
"
,
'
color:
'
+
colorStr
+
'
;font-size: 12px;font-weight: bold;
'
);
console
.
log
(
"
【本地文件】:
"
,
Logger
.
filePath
);
console
.
log
(
"
【返回数据】:
"
,
Logger
.
result
);
console
.
log
(
"
【预览地址】:
"
,
Logger
.
result
.
fileID
);
console
.
log
(
"
【上传耗时】:
"
,
Logger
.
runTime
,
"
毫秒
"
);
console
.
log
(
"
【上传时间】:
"
,
vk
.
pubfn
.
timeFormat
(
Logger
.
startTime
,
"
yyyy-MM-dd hh:mm:ss
"
));
if
(
Logger
.
error
)
console
.
error
(
"
【error】:
"
,
Logger
.
error
);
console
.
log
(
"
%c--------【结束】【阿里云oss文件上传】--------
"
,
'
color:
'
+
colorStr
+
'
;font-size: 12px;font-weight: bold;
'
);
});
uploadTask
.
onProgressUpdate
((
res
)
=>
{
if
(
res
.
progress
>
0
)
{
if
(
typeof
obj
.
onUploadProgress
===
"
function
"
)
obj
.
onUploadProgress
(
res
);
}
}
});
uploadTask
.
onProgressUpdate
((
res
)
=>
{
if
(
res
.
progress
>
0
)
{
if
(
typeof
obj
.
onUploadProgress
===
"
function
"
)
obj
.
onUploadProgress
(
res
);
}
});
});
return
uploadTask
;
};
...
...
uni_modules/vk-unicloud/vk_modules/vk-unicloud-page/libs/vk-unicloud/vk-unicloud-callFunctionUtil.js
浏览文件 @
2afbac06
...
...
@@ -377,8 +377,6 @@ class CallFunctionUtil {
res
.
fileID
=
tempFileURL
;
res
.
url
=
tempFileURL
;
res
.
file_id
=
fileID
;
if
(
typeof
success
==
"
function
"
)
success
(
res
);
resolve
(
res
);
if
(
needSave
)
{
// 保存文件记录到数据库
vk
.
userCenter
.
addUploadRecord
({
...
...
@@ -391,8 +389,19 @@ class CallFunctionUtil {
category_id
,
},
filePath
,
fileType
fileType
,
success
:
function
()
{
if
(
typeof
success
==
"
function
"
)
success
(
res
);
resolve
(
res
);
},
fail
:
function
(
res
)
{
if
(
typeof
fail
===
"
function
"
)
fail
(
res
);
reject
(
res
);
}
});
}
else
{
if
(
typeof
success
==
"
function
"
)
success
(
res
);
resolve
(
res
);
}
},
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录