Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
02b6df4c
Commit
02b6df4c
authored
Sep 27, 2023
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload
parent
e942d41c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
15 deletions
+25
-15
src/components/index/SignUp/referInfo.vue
src/components/index/SignUp/referInfo.vue
+14
-14
src/config/server.js
src/config/server.js
+1
-1
src/request/index/cosUpload.js
src/request/index/cosUpload.js
+10
-0
No files found.
src/components/index/SignUp/referInfo.vue
View file @
02b6df4c
...
@@ -965,7 +965,7 @@
...
@@ -965,7 +965,7 @@
/* eslint-disable */
/* eslint-disable */
import
{
delPic
,
getAccount
,
getProAndCity
,
getSchool
,
setAccount
}
from
"
r/index/signUp
"
;
import
{
delPic
,
getAccount
,
getProAndCity
,
getSchool
,
setAccount
}
from
"
r/index/signUp
"
;
import
COS
from
"
cos-js-sdk-v5
"
;
import
COS
from
"
cos-js-sdk-v5
"
;
import
{
cosSignature
,
getSignature
}
from
"
r/index/cosUpload
"
;
import
{
cosSignature
,
achievementCallBack
}
from
"
r/index/cosUpload
"
;
import
validator
from
"
common/validator
"
;
import
validator
from
"
common/validator
"
;
import
area
from
"
config/area
"
;
import
area
from
"
config/area
"
;
import
cueDialog
from
"
c/index/cueDialog
"
;
import
cueDialog
from
"
c/index/cueDialog
"
;
...
@@ -1800,7 +1800,7 @@
...
@@ -1800,7 +1800,7 @@
async
getCosConfigs
(
image
,
file
)
{
async
getCosConfigs
(
image
,
file
)
{
console
.
log
(
file
)
console
.
log
(
file
)
this
.
loading
=
true
;
this
.
loading
=
true
;
await
getSignature
(
1
)
await
cosSignature
({
image
:
image
,
index
:
'
1
'
}
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
res
,
"
开始上传图片
"
);
console
.
log
(
res
,
"
开始上传图片
"
);
let
resData
=
res
.
data
.
data
let
resData
=
res
.
data
.
data
...
@@ -1809,19 +1809,19 @@
...
@@ -1809,19 +1809,19 @@
// 必选参数
// 必选参数
getAuthorization
:
(
options
,
callback
)
=>
{
getAuthorization
:
(
options
,
callback
)
=>
{
callback
({
callback
({
TmpSecretId
:
resData
.
credential
.
credentials
.
tmpSecretId
,
TmpSecretId
:
resData
.
credential
s
.
credential
.
credentials
.
tmpSecretId
,
TmpSecretKey
:
resData
.
credential
.
credentials
.
tmpSecretKey
,
TmpSecretKey
:
resData
.
credential
s
.
credential
.
credentials
.
tmpSecretKey
,
XCosSecurityToken
:
resData
.
credential
.
credentials
.
sessionToken
,
XCosSecurityToken
:
resData
.
credential
s
.
credential
.
credentials
.
sessionToken
,
StartTime
:
resData
.
credential
.
startTime
,
// 时间戳,单位秒,如:1580000000
StartTime
:
resData
.
credential
s
.
credential
.
startTime
,
// 时间戳,单位秒,如:1580000000
ExpiredTime
:
resData
.
credential
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
ExpiredTime
:
resData
.
credential
s
.
credential
.
expiredTime
,
// 时间戳,单位秒,如:1580000900
});
});
},
},
});
});
console
.
log
(
resData
)
console
.
log
(
resData
)
cos
.
putObject
({
cos
.
putObject
({
Bucket
:
resData
.
bucket
,
Bucket
:
resData
.
credentials
.
bucket
,
Region
:
resData
.
region
,
Region
:
resData
.
credentials
.
region
,
Key
:
'
111/fg.png
'
,
Key
:
resData
.
key
,
Body
:
file
,
Body
:
file
,
onProgress
:
(
progressData
)
=>
{
onProgress
:
(
progressData
)
=>
{
console
.
log
(
"
上传进度:
"
+
JSON
.
stringify
(
progressData
));
console
.
log
(
"
上传进度:
"
+
JSON
.
stringify
(
progressData
));
...
@@ -1835,7 +1835,7 @@
...
@@ -1835,7 +1835,7 @@
this
.
$message
.
error
(
'
上传失败!
'
)
this
.
$message
.
error
(
'
上传失败!
'
)
}
else
{
}
else
{
console
.
log
(
data
);
console
.
log
(
data
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
,
image
);
this
.
signUploadSuccess
(
'
http://
'
+
data
.
Location
,
resData
);
}
}
}
}
);
);
...
@@ -1849,8 +1849,8 @@
...
@@ -1849,8 +1849,8 @@
});
});
},
},
// cos上传-告诉后端上传成功
// cos上传-告诉后端上传成功
async
signUploadSuccess
(
path
,
image
)
{
async
signUploadSuccess
(
path
,
resData
)
{
await
cosSignature
({
image
:
image
,
index
:
'
1
'
}).
then
(
res
=>
{
await
achievementCallBack
({
key
:
resData
.
key
,
index
:
1
}).
then
(
res
=>
{
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
this
.
loading
=
false
;
this
.
loading
=
false
;
return
this
.
$message
.
error
(
'
上传失败!
'
);
return
this
.
$message
.
error
(
'
上传失败!
'
);
...
@@ -1860,7 +1860,7 @@
...
@@ -1860,7 +1860,7 @@
this
.
resultPicture
=
path
+
"
?t=
"
+
Date
.
parse
(
new
Date
());
this
.
resultPicture
=
path
+
"
?t=
"
+
Date
.
parse
(
new
Date
());
this
.
$forceUpdate
();
this
.
$forceUpdate
();
let
obj
=
{
let
obj
=
{
url
:
res
.
data
.
savefile
,
url
:
res
.
data
.
picture_path
,
};
};
this
.
fileList
.
push
(
obj
);
this
.
fileList
.
push
(
obj
);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
let
code
=
this
.
$store
.
state
.
indexIdentity
;
...
...
src/config/server.js
View file @
02b6df4c
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
// export const SERVER_WS_URL = "wss://apiy.thuers.com"; // websocket
// export const SERVER_WS_URL = "wss://apiy.thuers.com"; // websocket
// 测试
// 测试
export
const
SERVER_URL
=
"
https://tgwapi.campcenter.cn/modules-campsite
"
;
// 正式环境
export
const
SERVER_URL
=
"
https://tgwapi.campcenter.cn/modules-campsite
"
;
// 正式环境
export
const
DEVELOPMENT_SERVER_URL
=
"
https://tgwapi.campcenter.cn/modules-campsite
"
;
//开发环境
export
const
DEVELOPMENT_SERVER_URL
=
"
https://tgwapi.campcenter.cn/modules-campsite
"
;
//开发环境
export
const
SERVER_WS_URL
=
"
wss://tgwapi.campcenter.cn
"
;
// websocket
export
const
SERVER_WS_URL
=
"
wss://tgwapi.campcenter.cn
"
;
// websocket
src/request/index/cosUpload.js
View file @
02b6df4c
...
@@ -7,6 +7,7 @@ export function getSignature(index) {
...
@@ -7,6 +7,7 @@ export function getSignature(index) {
url
:
`/web/download/getSignature/
${
index
}
`
,
url
:
`/web/download/getSignature/
${
index
}
`
,
})
})
}
}
//cos签名-web直传 1-个人信息上传2-作业上传3-银行缴费截图上传
//cos签名-web直传 1-个人信息上传2-作业上传3-银行缴费截图上传
export
function
cosSignature
(
data
)
{
export
function
cosSignature
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
...
@@ -16,3 +17,12 @@ export function cosSignature(data) {
...
@@ -16,3 +17,12 @@ export function cosSignature(data) {
data
data
})
})
}
}
export
function
achievementCallBack
(
data
)
{
data
[
'
identity
'
]
=
store
.
state
.
indexIdentity
;
return
request
({
method
:
'
post
'
,
url
:
'
/web/notify/achievementCallBack
'
,
data
})
}
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