Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tokcos-socket-web-ts-user
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
小豪
tokcos-socket-web-ts-user
Commits
3ed4e7f7
提交
3ed4e7f7
authored
5月 06, 2024
作者:
Hao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
聊天修改
父级
9ce4221f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
69 行增加
和
30 行删除
+69
-30
.env.development
+2
-2
.env.production
+2
-2
index.html
+22
-1
src/assets/up.svg
+2
-0
src/components/AutomaticPrompt.vue
+30
-6
src/minxins/UploadMixin.ts
+4
-18
src/router/index.ts
+6
-0
src/views/HomeView.vue
+0
-0
src/views/loginView.vue
+1
-1
没有找到文件。
.env.development
浏览文件 @
3ed4e7f7
NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.135
\ No newline at end of file
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
.env.production
浏览文件 @
3ed4e7f7
NODE_ENV=production
VITE_USER_APP_API_URL=192.168.31.101
\ No newline at end of file
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
index.html
浏览文件 @
3ed4e7f7
...
...
@@ -9,12 +9,32 @@
</head>
<body>
<noscript>
<strong>
We're sorry but
<
%=
htmlWebpackPlugin
.
options
.
title
%
>
doesn't work properly without JavaScript enabled.
Please enable it to continue.
</strong>
</noscript>
<div
id=
"app"
></div>
<script
type=
"module"
src=
"/src/main.ts"
></script>
<script>
window
.
onresize
=
()
=>
{
let
targetWidth
=
1600
;
// 2.拿到当前设备(浏览器)的宽度
// document.documentElement 获取html的宽度
let
currentWidth
=
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
;
console
.
log
(
currentWidth
)
// 3.计算缩放比率(屏幕过宽,根据高度计算缩放比例)
let
scaleRatio
=
currentWidth
/
targetWidth
;
let
fontSize
=
(
currentWidth
/
targetWidth
)
*
100
;
// 4.开始缩放网页
console
.
log
(
scaleRatio
,
fontSize
,
'scaleRatio'
)
// 4.开始缩放网页
console
.
log
(
scaleRatio
,
'scaleRatio'
)
document
.
body
.
style
=
`zoom:
${
scaleRatio
}
`
;
console
.
log
(
document
.
body
,
' document.body'
)
}
</script>
</body>
</html>
\ No newline at end of file
src/assets/up.svg
0 → 100644
浏览文件 @
3ed4e7f7
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1714962974283"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"2311"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><path
d=
"M270.387 27.273l484.233 485.222-485.222 484.233z"
fill=
"#1C2021"
p-id=
"2312"
></path></svg>
\ No newline at end of file
src/components/AutomaticPrompt.vue
浏览文件 @
3ed4e7f7
...
...
@@ -55,7 +55,7 @@
style=
"display: none;"
accept=
"image/bmp,image/jpeg,image/jpg,image/png"
type=
"file"
@
change=
"fileChange"
@
change=
"file
Img
Change"
/>
</div>
</
template
>
...
...
@@ -80,12 +80,18 @@ const upfile = () => {
file
.
value
.
click
()
}
//上传的数据
const
file
Change
=
()
=>
{
const
file
ImgChange
=
async
()
=>
{
var
e
:
any
=
window
.
event
||
event
var
oFile
=
e
.
target
.
files
[
0
]
upLoadFilesHander
(
oFile
).
then
((
ress
)
=>
{
const
{
success
,
result
}:
any
=
ress
console
.
log
(
oFile
.
type
)
if
(
oFile
.
type
==
'image/png'
)
{
await
setfileEvent
(
e
.
target
)
}
else
{
upLoadFilesHander
(
oFile
).
then
((
ress
)
=>
{
const
{
success
,
result
}:
any
=
ress
;
console
.
log
(
result
,)
})
}
const
loading
:
any
=
ElLoading
?.
service
({
lock
:
true
,
text
:
'上传中...'
,
...
...
@@ -93,10 +99,27 @@ const fileChange = () => {
})
loading
.
close
()
}
const
setfileEvent
=
async
(
clipboardData
:
any
)
=>
{
const
img
=
getPasteImageFile
(
clipboardData
.
files
)
if
(
!
img
)
{
return
}
const
uploadRes
=
await
fileToBase64
(
img
)
if
(
!
uploadRes
)
{
return
}
const
oImage
=
await
getImageObject
(
uploadRes
,
imgShowWidth
.
value
,
imgShowHeight
.
value
,
)
console
.
log
(
oImage
,
'oImage'
)
elAutocomplete
.
value
.
innerHTML
+=
oImage
.
outerHTML
inputVal
.
value
=
oImage
.
outerHTML
elAutocomplete
.
value
.
focus
()
}
const
handleSelect
=
(
value
:
any
)
=>
{
inputVal
.
value
=
value
.
target
.
innerHTML
console
.
log
(
inputVal
.
value
,
'打印一下'
)
}
const
emit
=
defineEmits
([
'updateState'
])
...
...
@@ -149,6 +172,7 @@ const handlePasteImageFile = async (clipboardData: any) => {
)
cursorInsert
(
oImage
)
inputVal
.
value
=
elAutocomplete
.
value
.
innerHTML
// elAutocomplete.value.innerHTML = inputVal.value;
}
// 获取一个 image object
...
...
src/minxins/UploadMixin.ts
浏览文件 @
3ed4e7f7
...
...
@@ -99,7 +99,6 @@ export const upLoadHander = async (obj: any) => {
uploadMixin
.
uploadMixinType
=
result
.
uploadType
;
staticDomain
=
result
.
staticDomain
||
"https://cdn.tikcos.cn"
;
if
(
uploadMixin
.
uploadMixinType
===
"txcos"
)
{
console
.
log
(
result
.
response
,
" result.response"
);
const
ress
=
res
.
result
.
response
;
const
credentials
=
ress
.
credentials
;
uploadMixin
.
uploadMixinCredentials
=
{
...
...
@@ -109,11 +108,6 @@ export const upLoadHander = async (obj: any) => {
StartTime
:
ress
?.
startTime
,
ExpiredTime
:
ress
?.
expiredTime
,
};
console
.
log
(
result
,
"result"
);
console
.
log
(
uploadMixin
.
uploadMixinCredentials
,
" uploadMixin.uploadMixinCredentials"
);
}
}
else
{
resResult
=
false
;
...
...
@@ -123,10 +117,7 @@ export const upLoadHander = async (obj: any) => {
if
(
resResult
)
{
const
query
=
{};
// const res: any = await getUploadConfigInfo(query);
console
.
log
(
uploadMixin
.
uploadMixinCredentials
,
" console.log(uploadMixin.uploadMixinCredentials)"
);
const
result
:
any
=
uploadMixin
.
upLoadMixinResult
;
if
(
uploadMixin
.
uploadMixinType
===
"txcos"
)
{
//走对象存储
...
...
@@ -147,17 +138,10 @@ export const upLoadHander = async (obj: any) => {
Key
:
uploadMixin
.
uploadMixinPath
+
tempFolder
+
folder
,
Body
:
fileInfo
.
file
,
onProgress
:
function
(
progressData
)
{
console
.
log
(
progressData
,
"ada"
);
obj
.
onProgress
(
progressData
);
},
},
(
err
,
data
)
=>
{
console
.
log
(
err
,
data
,
"打印一下"
);
console
.
log
({
success
:
true
});
console
.
log
(
`
${
staticDomain
}
/
${
uploadMixin
.
uploadMixinPath
}${
tempFolder
}${
folder
}
`
,
"打印一下,数据"
);
if
(
!
err
&&
data
.
statusCode
===
200
)
{
const
imgurl
=
`
${
staticDomain
}
/
${
uploadMixin
.
uploadMixinPath
}${
tempFolder
}${
folder
}
`
;
...
...
@@ -178,7 +162,8 @@ export const upLoadHander = async (obj: any) => {
let
formData
=
new
FormData
();
formData
.
append
(
"biz"
,
fileInfo
.
biz
);
formData
.
append
(
"file"
,
newFile
);
const
uploadRes
=
await
axios
.
post
(
`http://
${
VUE_APP_API_URL
}
:8080/sys/common/upload`
,
const
uploadRes
=
await
axios
.
post
(
`http://
${
VUE_APP_API_URL
}
:8080/sys/common/upload`
,
formData
,
{
headers
:
{
...
obj
.
headers
},
...
...
@@ -193,6 +178,7 @@ export const upLoadHander = async (obj: any) => {
url
=
uploadRes
.
message
.
replaceAll
(
"//"
,
"/"
);
const
pre
=
url
.
startsWith
(
"/"
)
?
""
:
"/"
;
url
=
`http://
${
VUE_APP_API_URL
}
/sys/common/static`
+
pre
+
url
;
console
.
log
(
url
,
"图片上传失败"
);
obj
.
onSuccess
({
success
:
true
,
message
:
url
});
}
else
{
obj
.
onError
({
...
...
src/router/index.ts
浏览文件 @
3ed4e7f7
...
...
@@ -5,6 +5,12 @@ const routes: Array<RouteRecordRaw> = [
name
:
"home"
,
component
:
()
=>
import
(
/* @vite-ignore */
`@/views/HomeView.vue`
),
},
{
path
:
"/loging"
,
name
:
"loging"
,
component
:
()
=>
import
(
/* webpackChunkName: "about" */
`@/views/logingView.vue`
),
},
];
const
router
=
createRouter
({
...
...
src/views/HomeView.vue
浏览文件 @
3ed4e7f7
差异被折叠。
点击展开。
src/views/loginView.vue
浏览文件 @
3ed4e7f7
...
...
@@ -77,7 +77,7 @@ export default {
if
(
!
formEl
)
return
formEl
.
resetFields
()
}
//登录
const
submitForm
=
(
formEl
:
FormInstance
|
undefined
)
=>
{
if
(
!
formEl
)
return
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论