Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b3903e54
authored
Nov 28, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用新的cos上传替换旧的上传组件
1 parent
cac4a044
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
8 deletions
linkwe-pc/package.json
linkwe-pc/src/api/common.js
linkwe-pc/src/components/TagEllipsis.vue
linkwe-pc/src/components/Upload.vue
linkwe-pc/src/utils/jsencrypt.js
linkwe-pc/package.json
View file @
b3903e5
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
"benz-amr-recorder"
:
"^1.1.3"
,
"benz-amr-recorder"
:
"^1.1.3"
,
"clipboard"
:
"2.0.4"
,
"clipboard"
:
"2.0.4"
,
"core-js"
:
"^3.20.2"
,
"core-js"
:
"^3.20.2"
,
"cos-js-sdk-v5"
:
"^1.4.1
1
"
,
"cos-js-sdk-v5"
:
"^1.4.1
3
"
,
"crypto-js"
:
"^4.1.1"
,
"crypto-js"
:
"^4.1.1"
,
"driver.js"
:
"^0.9.8"
,
"driver.js"
:
"^0.9.8"
,
"echarts"
:
"^5.3.0"
,
"echarts"
:
"^5.3.0"
,
...
...
linkwe-pc/src/api/common.js
View file @
b3903e5
import
{
decryptAES
}
from
'@/utils/jsencrypt'
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
import
{
dataURLtoFile
}
from
'@/utils/common'
import
{
dataURLtoFile
}
from
'@/utils/common'
...
@@ -11,6 +12,28 @@ export function upload(data) {
...
@@ -11,6 +12,28 @@ export function upload(data) {
})
})
}
}
// 获取cos配置
export
function
getCosConfig
(
data
)
{
return
request
({
url
:
service
+
'/file/get/config'
,
params
:
data
,
}).
then
(({
data
})
=>
{
let
res
=
{}
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
res
[
key
]
=
decryptAES
(
data
[
key
])
})
return
res
})
}
// 获取视频第一帧
export
function
getVideoPic
(
params
)
{
return
request
({
url
:
window
.
lwConfig
.
services
.
system
+
'/file/getVideoFirstImg/'
,
params
,
})
}
/**
/**
* 下载网络连接文件
* 下载网络连接文件
* @param {*} params
* @param {*} params
...
@@ -20,11 +43,7 @@ export function upload(data) {
...
@@ -20,11 +43,7 @@ export function upload(data) {
}
}
*/
*/
export
function
download
(
url
,
name
)
{
export
function
download
(
url
,
name
)
{
return
(
return
window
.
lwConfig
.
DOMAIN
+
window
.
lwConfig
.
services
.
system
+
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
window
.
lwConfig
.
DOMAIN
+
window
.
lwConfig
.
services
.
system
+
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
)
}
}
/**
/**
...
...
linkwe-pc/src/components/TagEllipsis.vue
View file @
b3903e5
...
@@ -59,5 +59,8 @@ export default {
...
@@ -59,5 +59,8 @@ export default {
.tag-ellipsis
{
.tag-ellipsis
{
display
:
inline-block
;
display
:
inline-block
;
line-height
:
34px
;
line-height
:
34px
;
.el-tag
{
vertical-align
:
middle
;
}
}
}
</
style
>
</
style
>
linkwe-pc/src/components/Upload.vue
View file @
b3903e5
This diff is collapsed.
Click to expand it.
linkwe-pc/src/utils/jsencrypt.js
View file @
b3903e5
...
@@ -2,10 +2,12 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt'
...
@@ -2,10 +2,12 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt'
// 密钥对生成 http://web.chacuo.net/netrsakeypair
// 密钥对生成 http://web.chacuo.net/netrsakeypair
const
publicKey
=
'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n'
+
const
publicKey
=
'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n'
+
'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
const
privateKey
=
'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n'
+
const
privateKey
=
'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n'
+
'7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n'
+
'7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n'
+
'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n'
+
'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n'
+
'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n'
+
'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n'
+
...
@@ -28,3 +30,91 @@ export function decrypt(txt) {
...
@@ -28,3 +30,91 @@ export function decrypt(txt) {
return
encryptor
.
decrypt
(
txt
)
// 对数据进行解密
return
encryptor
.
decrypt
(
txt
)
// 对数据进行解密
}
}
// AES加密
import
CryptoJS
from
'crypto-js'
let
keyAES
=
'qykj@20221101_te'
//加密
export
function
encryptAES
(
str
)
{
var
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
keyAES
)
var
srcs
=
CryptoJS
.
enc
.
Utf8
.
parse
(
str
)
var
encrypted
=
CryptoJS
.
AES
.
encrypt
(
srcs
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
,
})
return
encrypted
.
toString
()
}
//解密
export
function
decryptAES
(
str
)
{
var
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
keyAES
)
var
decrypt
=
CryptoJS
.
AES
.
decrypt
(
str
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
,
})
return
CryptoJS
.
enc
.
Utf8
.
stringify
(
decrypt
).
toString
()
}
// base64加密
export
function
encryptB64
(
str
)
{
return
window
.
btoa
(
encodeURIComponent
(
str
).
replace
(
/%
([
0-9A-F
]{2})
/g
,
function
(
match
,
p1
)
{
return
String
.
fromCharCode
(
'0x'
+
p1
)
}),
)
}
// base64解密
export
function
decryptB64
(
str
)
{
const
keyStr
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
function
utf8_decode
(
utftext
)
{
var
string
=
''
var
i
=
0
var
c
=
0
var
c1
=
0
var
c2
=
0
while
(
i
<
utftext
.
length
)
{
c
=
utftext
.
charCodeAt
(
i
)
if
(
c
<
128
)
{
string
+=
String
.
fromCharCode
(
c
)
i
++
}
else
if
(
c
>
191
&&
c
<
224
)
{
c1
=
utftext
.
charCodeAt
(
i
+
1
)
string
+=
String
.
fromCharCode
(((
c
&
31
)
<<
6
)
|
(
c1
&
63
))
i
+=
2
}
else
{
c1
=
utftext
.
charCodeAt
(
i
+
1
)
c2
=
utftext
.
charCodeAt
(
i
+
2
)
string
+=
String
.
fromCharCode
(((
c
&
15
)
<<
12
)
|
((
c1
&
63
)
<<
6
)
|
(
c2
&
63
))
i
+=
3
}
}
return
string
}
function
decode
(
input
)
{
var
output
=
''
var
chr1
,
chr2
,
chr3
var
enc1
,
enc2
,
enc3
,
enc4
var
i
=
0
input
=
input
.
replace
(
/
[^
A-Za-z0-9
\+\/\=]
/g
,
''
)
while
(
i
<
input
.
length
)
{
enc1
=
keyStr
.
indexOf
(
input
.
charAt
(
i
++
))
enc2
=
keyStr
.
indexOf
(
input
.
charAt
(
i
++
))
enc3
=
keyStr
.
indexOf
(
input
.
charAt
(
i
++
))
enc4
=
keyStr
.
indexOf
(
input
.
charAt
(
i
++
))
chr1
=
(
enc1
<<
2
)
|
(
enc2
>>
4
)
chr2
=
((
enc2
&
15
)
<<
4
)
|
(
enc3
>>
2
)
chr3
=
((
enc3
&
3
)
<<
6
)
|
enc4
output
=
output
+
String
.
fromCharCode
(
chr1
)
if
(
enc3
!=
64
)
{
output
=
output
+
String
.
fromCharCode
(
chr2
)
}
if
(
enc4
!=
64
)
{
output
=
output
+
String
.
fromCharCode
(
chr3
)
}
}
output
=
utf8_decode
(
output
)
return
output
}
return
decode
(
str
)
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment