提交 3ed4e7f7 作者: Hao

聊天修改

父级 9ce4221f
NODE_ENV=development NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.135 VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file \ No newline at end of file
NODE_ENV=production NODE_ENV=production
VITE_USER_APP_API_URL=192.168.31.101 VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file \ No newline at end of file
...@@ -9,12 +9,32 @@ ...@@ -9,12 +9,32 @@
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong> Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <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> </body>
</html> </html>
\ No newline at end of file
<?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
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
style="display: none;" style="display: none;"
accept="image/bmp,image/jpeg,image/jpg,image/png" accept="image/bmp,image/jpeg,image/jpg,image/png"
type="file" type="file"
@change="fileChange" @change="fileImgChange"
/> />
</div> </div>
</template> </template>
...@@ -80,12 +80,18 @@ const upfile = () => { ...@@ -80,12 +80,18 @@ const upfile = () => {
file.value.click() file.value.click()
} }
//上传的数据 //上传的数据
const fileChange = () => { const fileImgChange = async () => {
var e: any = window.event || event var e: any = window.event || event
var oFile = e.target.files[0] var oFile = e.target.files[0]
upLoadFilesHander(oFile).then((ress) => { console.log(oFile.type)
const { success, result }: any = ress 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({ const loading: any = ElLoading?.service({
lock: true, lock: true,
text: '上传中...', text: '上传中...',
...@@ -93,10 +99,27 @@ const fileChange = () => { ...@@ -93,10 +99,27 @@ const fileChange = () => {
}) })
loading.close() 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) => { const handleSelect = (value: any) => {
inputVal.value = value.target.innerHTML inputVal.value = value.target.innerHTML
console.log(inputVal.value,'打印一下')
} }
const emit = defineEmits(['updateState']) const emit = defineEmits(['updateState'])
...@@ -149,6 +172,7 @@ const handlePasteImageFile = async (clipboardData: any) => { ...@@ -149,6 +172,7 @@ const handlePasteImageFile = async (clipboardData: any) => {
) )
cursorInsert(oImage) cursorInsert(oImage)
inputVal.value = elAutocomplete.value.innerHTML inputVal.value = elAutocomplete.value.innerHTML
// elAutocomplete.value.innerHTML = inputVal.value;
} }
// 获取一个 image object // 获取一个 image object
......
...@@ -99,7 +99,6 @@ export const upLoadHander = async (obj: any) => { ...@@ -99,7 +99,6 @@ export const upLoadHander = async (obj: any) => {
uploadMixin.uploadMixinType = result.uploadType; uploadMixin.uploadMixinType = result.uploadType;
staticDomain = result.staticDomain || "https://cdn.tikcos.cn"; staticDomain = result.staticDomain || "https://cdn.tikcos.cn";
if (uploadMixin.uploadMixinType === "txcos") { if (uploadMixin.uploadMixinType === "txcos") {
console.log(result.response, " result.response");
const ress = res.result.response; const ress = res.result.response;
const credentials = ress.credentials; const credentials = ress.credentials;
uploadMixin.uploadMixinCredentials = { uploadMixin.uploadMixinCredentials = {
...@@ -109,11 +108,6 @@ export const upLoadHander = async (obj: any) => { ...@@ -109,11 +108,6 @@ export const upLoadHander = async (obj: any) => {
StartTime: ress?.startTime, StartTime: ress?.startTime,
ExpiredTime: ress?.expiredTime, ExpiredTime: ress?.expiredTime,
}; };
console.log(result, "result");
console.log(
uploadMixin.uploadMixinCredentials,
" uploadMixin.uploadMixinCredentials"
);
} }
} else { } else {
resResult = false; resResult = false;
...@@ -123,10 +117,7 @@ export const upLoadHander = async (obj: any) => { ...@@ -123,10 +117,7 @@ export const upLoadHander = async (obj: any) => {
if (resResult) { if (resResult) {
const query = {}; const query = {};
// const res: any = await getUploadConfigInfo(query); // const res: any = await getUploadConfigInfo(query);
console.log(
uploadMixin.uploadMixinCredentials,
" console.log(uploadMixin.uploadMixinCredentials)"
);
const result: any = uploadMixin.upLoadMixinResult; const result: any = uploadMixin.upLoadMixinResult;
if (uploadMixin.uploadMixinType === "txcos") { if (uploadMixin.uploadMixinType === "txcos") {
//走对象存储 //走对象存储
...@@ -147,17 +138,10 @@ export const upLoadHander = async (obj: any) => { ...@@ -147,17 +138,10 @@ export const upLoadHander = async (obj: any) => {
Key: uploadMixin.uploadMixinPath + tempFolder + folder, Key: uploadMixin.uploadMixinPath + tempFolder + folder,
Body: fileInfo.file, Body: fileInfo.file,
onProgress: function (progressData) { onProgress: function (progressData) {
console.log(progressData, "ada");
obj.onProgress(progressData); obj.onProgress(progressData);
}, },
}, },
(err, data) => { (err, data) => {
console.log(err, data, "打印一下");
console.log({ success: true });
console.log(
`${staticDomain}/${uploadMixin.uploadMixinPath}${tempFolder}${folder}`,
"打印一下,数据"
);
if (!err && data.statusCode === 200) { if (!err && data.statusCode === 200) {
const imgurl = `${staticDomain}/${uploadMixin.uploadMixinPath}${tempFolder}${folder}`; const imgurl = `${staticDomain}/${uploadMixin.uploadMixinPath}${tempFolder}${folder}`;
...@@ -178,7 +162,8 @@ export const upLoadHander = async (obj: any) => { ...@@ -178,7 +162,8 @@ export const upLoadHander = async (obj: any) => {
let formData = new FormData(); let formData = new FormData();
formData.append("biz", fileInfo.biz); formData.append("biz", fileInfo.biz);
formData.append("file", newFile); 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, formData,
{ {
headers: { ...obj.headers }, headers: { ...obj.headers },
...@@ -193,6 +178,7 @@ export const upLoadHander = async (obj: any) => { ...@@ -193,6 +178,7 @@ export const upLoadHander = async (obj: any) => {
url = uploadRes.message.replaceAll("//", "/"); url = uploadRes.message.replaceAll("//", "/");
const pre = url.startsWith("/") ? "" : "/"; const pre = url.startsWith("/") ? "" : "/";
url = `http://${VUE_APP_API_URL}/sys/common/static` + pre + url; url = `http://${VUE_APP_API_URL}/sys/common/static` + pre + url;
console.log(url, "图片上传失败");
obj.onSuccess({ success: true, message: url }); obj.onSuccess({ success: true, message: url });
} else { } else {
obj.onError({ obj.onError({
......
...@@ -5,6 +5,12 @@ const routes: Array<RouteRecordRaw> = [ ...@@ -5,6 +5,12 @@ const routes: Array<RouteRecordRaw> = [
name: "home", name: "home",
component: () => import(/* @vite-ignore */ `@/views/HomeView.vue`), component: () => import(/* @vite-ignore */ `@/views/HomeView.vue`),
}, },
{
path: "/loging",
name: "loging",
component: () =>
import(/* webpackChunkName: "about" */ `@/views/logingView.vue`),
},
]; ];
const router = createRouter({ const router = createRouter({
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
if (!formEl) return if (!formEl) return
formEl.resetFields() formEl.resetFields()
} }
//登录
const submitForm = (formEl: FormInstance | undefined) => { const submitForm = (formEl: FormInstance | undefined) => {
if (!formEl) return if (!formEl) return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论