Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-app
Commits
8da2d5b2
Commit
8da2d5b2
authored
Apr 25, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了学历认证和工作认证上传
parent
1d0e3882
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
150 additions
and
41 deletions
+150
-41
educationcertification.vue
pagesme/me/educationcertification.vue
+73
-19
updateInformation.vue
pagesme/me/updateInformation.vue
+2
-2
workcertification.vue
pagesme/me/workcertification.vue
+75
-20
No files found.
pagesme/me/educationcertification.vue
View file @
8da2d5b2
...
...
@@ -25,7 +25,7 @@
<
script
>
import
ELM
from
'@/components/elm-toast/index.vue'
;
import
{
updateUser
,
userDetail
}
from
"../../api/user"
;
import
{
getOssUrl
}
from
"../../api/article"
;
import
{
getOssUrl
,
getUploadType
}
from
"../../api/article"
;
export
default
{
data
()
{
return
{
...
...
@@ -36,7 +36,8 @@
singleNoShow
:
false
,
tipMsg
:
''
,
isConfirm
:
false
,
educationPictureUrl
:
null
educationPictureUrl
:
null
,
uploadType
:
'aliYun_direct'
}
},
components
:
{
...
...
@@ -44,8 +45,15 @@
},
onShow
()
{
this
.
loadPage
();
this
.
getUploadType
()
},
methods
:
{
// 获取上传类型 判断当前是oss上传还是本地上传
getUploadType
(){
getUploadType
().
then
(
res
=>
{
this
.
uploadType
=
res
.
data
.
data
})
},
singleNoClose
()
{
this
.
singleNoShow
=
false
;
},
...
...
@@ -73,23 +81,69 @@
uni
.
showLoading
({
title
:
"图片上传中"
})
uni
.
uploadFile
({
url
:
this
.
$BASE_URL
+
'/common/fileUpload'
,
filePath
:
i
,
formData
:
{
file
:
i
,
temp
:
'opmArticle'
,
bucket
:
'cust-91isoft'
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
),
},
name
:
'file'
,
success
:
(
uploadFileRes
)
=>
{
let
res
=
JSON
.
parse
(
uploadFileRes
.
data
)
this
.
updateImage
(
res
.
data
.
businessId
);
},
});
if
(
this
.
uploadType
===
'aliYun_direct'
){
// oss直传
uni
.
uploadFile
({
// url: 'http://192.168.1.18:8082/common/aliyunOssFileUploadByWx',
url
:
this
.
$BASE_URL
+
'/common/aliyunOssFileUploadByWx'
,
filePath
:
i
,
formData
:
{
file
:
i
,
//你要传的临时文件
temp
:
'opmMember'
,
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
),
},
name
:
'file'
,
success
:
(
res
)
=>
{
let
response
=
JSON
.
parse
(
res
.
data
)
const
formData
=
{
key
:
response
.
data
.
url
,
//上传文件名称
policy
:
response
.
data
.
policy
,
//表单域
'x-oss-signature-version'
:
response
.
data
.
x_oss_signature_version
,
//指定签名的版本和算法
'x-oss-credential'
:
response
.
data
.
x_oss_credential
,
//指明派生密钥的参数集
'x-oss-date'
:
response
.
data
.
x_oss_date
,
//请求的时间
'x-oss-signature'
:
response
.
data
.
signature
,
//签名认证描述信息
'x-oss-security-token'
:
response
.
data
.
security_token
,
//安全令牌
success_action_status
:
"200"
//上传成功后响应状态码
};
wx
.
uploadFile
({
url
:
response
.
data
.
ossDomainName
,
// 此域名仅作示例,实际Bucket域名,请替换为您的目标Bucket域名。
filePath
:
i
,
name
:
'file'
,
//固定值为file
formData
:
formData
,
success
:(
res1
)
=>
{
console
.
log
(
'上传响应:'
,
res1
);
this
.
updateImage
(
response
.
data
.
ossInfoId
);
uni
.
$off
(
'Cropper'
);
// 移除事件监听 否则会叠加调用
},
fail
:(
err
)
=>
{
console
.
error
(
'上传失败:'
,
err
);
// 输出错误信息
wx
.
showToast
({
title
:
'上传失败,请重试!'
,
icon
:
'none'
});
}
});
},
});
}
else
{
// 本地上传 oss服务端上传 minio上传
uni
.
uploadFile
({
// url: 'http://192.168.1.18:8082/common/fileUpload',
url
:
this
.
$BASE_URL
+
'/common/fileUpload'
,
filePath
:
i
,
formData
:
{
file
:
i
,
//你要传的临时文件
temp
:
'opmArticle'
,
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
),
},
name
:
'file'
,
success
:
(
uploadFileRes
)
=>
{
let
res
=
JSON
.
parse
(
uploadFileRes
.
data
)
this
.
updateImage
(
res
.
data
.
businessId
);
},
});
}
});
}
});
...
...
pagesme/me/updateInformation.vue
View file @
8da2d5b2
...
...
@@ -254,8 +254,8 @@ import {getOssUrl, getUploadType} from "../../api/article";
singleNoShow
:
false
,
singleIndex
:
0
,
waitApprovedImg
:
[],
// oss上传类型
aliYun local
uploadType
:
'aliYun'
// oss上传类型
uploadType
:
'aliYun
_direct
'
}
},
computed
:
{
...
...
pagesme/me/workcertification.vue
View file @
8da2d5b2
...
...
@@ -25,7 +25,7 @@
<
script
>
import
ELM
from
'@/components/elm-toast/index.vue'
;
import
{
updateUser
,
userDetail
}
from
"../../api/user"
;
import
{
getOssUrl
}
from
"../../api/article"
;
import
{
getOssUrl
,
getUploadType
}
from
"../../api/article"
;
export
default
{
data
()
{
return
{
...
...
@@ -36,16 +36,25 @@
singleNoShow
:
false
,
tipMsg
:
''
,
isConfirm
:
false
,
educationPictureUrl
:
null
educationPictureUrl
:
null
,
// oss上传类型
uploadType
:
'aliYun_direct'
}
},
components
:
{
ELM
},
onShow
()
{
this
.
loadPage
();
this
.
loadPage
()
this
.
getUploadType
()
},
methods
:
{
// 获取上传类型 判断当前是oss上传还是本地上传
getUploadType
(){
getUploadType
().
then
(
res
=>
{
this
.
uploadType
=
res
.
data
.
data
})
},
singleNoClose
()
{
this
.
singleNoShow
=
false
;
},
...
...
@@ -73,23 +82,69 @@
uni
.
showLoading
({
title
:
"图片上传中"
})
uni
.
uploadFile
({
url
:
this
.
$BASE_URL
+
'/common/fileUpload'
,
filePath
:
i
,
formData
:
{
file
:
i
,
temp
:
'opmArticle'
,
bucket
:
'cust-91isoft'
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
),
},
name
:
'file'
,
success
:
(
uploadFileRes
)
=>
{
let
res
=
JSON
.
parse
(
uploadFileRes
.
data
)
this
.
updateImage
(
res
.
data
.
businessId
);
},
});
if
(
this
.
uploadType
===
'aliYun_direct'
){
// oss直传
uni
.
uploadFile
({
// url: 'http://192.168.1.18:8082/common/aliyunOssFileUploadByWx',
url
:
this
.
$BASE_URL
+
'/common/aliyunOssFileUploadByWx'
,
filePath
:
i
,
formData
:
{
file
:
i
,
//你要传的临时文件
temp
:
'opmMember'
,
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
),
},
name
:
'file'
,
success
:
(
res
)
=>
{
let
response
=
JSON
.
parse
(
res
.
data
)
const
formData
=
{
key
:
response
.
data
.
url
,
//上传文件名称
policy
:
response
.
data
.
policy
,
//表单域
'x-oss-signature-version'
:
response
.
data
.
x_oss_signature_version
,
//指定签名的版本和算法
'x-oss-credential'
:
response
.
data
.
x_oss_credential
,
//指明派生密钥的参数集
'x-oss-date'
:
response
.
data
.
x_oss_date
,
//请求的时间
'x-oss-signature'
:
response
.
data
.
signature
,
//签名认证描述信息
'x-oss-security-token'
:
response
.
data
.
security_token
,
//安全令牌
success_action_status
:
"200"
//上传成功后响应状态码
};
wx
.
uploadFile
({
url
:
response
.
data
.
ossDomainName
,
// 此域名仅作示例,实际Bucket域名,请替换为您的目标Bucket域名。
filePath
:
i
,
name
:
'file'
,
//固定值为file
formData
:
formData
,
success
:(
res1
)
=>
{
console
.
log
(
'上传响应:'
,
res1
);
this
.
updateImage
(
response
.
data
.
ossInfoId
);
uni
.
$off
(
'Cropper'
);
// 移除事件监听 否则会叠加调用
},
fail
:(
err
)
=>
{
console
.
error
(
'上传失败:'
,
err
);
// 输出错误信息
wx
.
showToast
({
title
:
'上传失败,请重试!'
,
icon
:
'none'
});
}
});
},
});
}
else
{
// 本地上传 oss服务端上传 minio上传
uni
.
uploadFile
({
// url: 'http://192.168.1.18:8082/common/fileUpload',
url
:
this
.
$BASE_URL
+
'/common/fileUpload'
,
filePath
:
i
,
formData
:
{
file
:
i
,
//你要传的临时文件
temp
:
'opmArticle'
,
},
header
:
{
Authorization
:
'Bearer '
+
uni
.
getStorageSync
(
"token"
),
},
name
:
'file'
,
success
:
(
uploadFileRes
)
=>
{
let
res
=
JSON
.
parse
(
uploadFileRes
.
data
)
this
.
updateImage
(
res
.
data
.
businessId
);
},
});
}
});
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment