文件上传部署版本
This commit is contained in:
parent
d541c7b060
commit
f4aaa5bfe0
3
.env
3
.env
@ -23,6 +23,9 @@ VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc
|
|||||||
#AI路径
|
#AI路径
|
||||||
VITE_AI_URL = http://192.168.1.25:8000
|
VITE_AI_URL = http://192.168.1.25:8000
|
||||||
|
|
||||||
|
#Onlyoffice相关
|
||||||
|
VITE_ONLY_URL = http://140.143.164.40:48080
|
||||||
|
|
||||||
# 默认账户密码
|
# 默认账户密码
|
||||||
VITE_APP_DEFAULT_LOGIN_TENANT = 君风科技
|
VITE_APP_DEFAULT_LOGIN_TENANT = 君风科技
|
||||||
VITE_APP_DEFAULT_LOGIN_USERNAME = admin
|
VITE_APP_DEFAULT_LOGIN_USERNAME = admin
|
||||||
|
@ -165,7 +165,7 @@ const upload = async (myFile:any) => {
|
|||||||
}
|
}
|
||||||
formData.append('file', myFile);//拿到的信息来加入form
|
formData.append('file', myFile);//拿到的信息来加入form
|
||||||
try {
|
try {
|
||||||
await axios.post('http://192.168.1.15:48080/admin-api/only/onlyof/update', formData, configs);
|
await axios.post('${config.only_url}/admin-api/only/onlyof/update', formData, configs);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Upload failed:', error);
|
console.error('Upload failed:', error);
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ const edit = async (row) => {
|
|||||||
}
|
}
|
||||||
const token = getAccessToken();
|
const token = getAccessToken();
|
||||||
// window.open(`http://192.168.1.15:48080/admin-api/only/onlyof/edit?name=${name}&userName=admin&userId=1&id=${iid}&token=${token}`);
|
// window.open(`http://192.168.1.15:48080/admin-api/only/onlyof/edit?name=${name}&userName=admin&userId=1&id=${iid}&token=${token}`);
|
||||||
window.open(`http://192.168.1.15:48080/admin-api/only/onlyof/edit?name=${name}&userName=admin&userId=1&token=${token}`);
|
window.open(`${config.only_url}/admin-api/only/onlyof/edit?name=${name}&userName=admin&userId=1&token=${token}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 下载文件
|
// 下载文件
|
||||||
@ -348,7 +348,7 @@ const download = async (row) => {
|
|||||||
try {
|
try {
|
||||||
const token = getAccessToken();
|
const token = getAccessToken();
|
||||||
//拿文件状态
|
//拿文件状态
|
||||||
const response = await axios.get(`http://192.168.1.15:48080/admin-api/only/onlyof/editStatus?name=${name}&token=${token}`);
|
const response = await axios.get(`${config.only_url}/admin-api/only/onlyof/editStatus?name=${name}&token=${token}`);
|
||||||
if (response.data.error === 0) {
|
if (response.data.error === 0) {
|
||||||
alert('文档正在编辑,5秒后开始下载最新版!');
|
alert('文档正在编辑,5秒后开始下载最新版!');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const config: {
|
const config: {
|
||||||
base_url: string
|
base_url: string
|
||||||
ai_url: string
|
ai_url: string
|
||||||
|
only_url: string
|
||||||
result_code: number | string
|
result_code: number | string
|
||||||
default_headers: AxiosHeaders
|
default_headers: AxiosHeaders
|
||||||
request_timeout: number
|
request_timeout: number
|
||||||
@ -10,6 +11,7 @@ const config: {
|
|||||||
*/
|
*/
|
||||||
base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
|
base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
|
||||||
ai_url: import.meta.env.VITE_AI_URL,
|
ai_url: import.meta.env.VITE_AI_URL,
|
||||||
|
only_url: import.meta.env.VITE_ONLY_URL,
|
||||||
/**
|
/**
|
||||||
* 接口成功返回状态码
|
* 接口成功返回状态码
|
||||||
*/
|
*/
|
||||||
|
1
types/env.d.ts
vendored
1
types/env.d.ts
vendored
@ -27,6 +27,7 @@ interface ImportMetaEnv {
|
|||||||
readonly VITE_SOURCEMAP: string
|
readonly VITE_SOURCEMAP: string
|
||||||
readonly VITE_OUT_DIR: string
|
readonly VITE_OUT_DIR: string
|
||||||
readonly VITE_AI_URL: string
|
readonly VITE_AI_URL: string
|
||||||
|
readonly VITE_ONLY_URL: string
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
Loading…
Reference in New Issue
Block a user