diff --git a/src/App.vue b/src/App.vue
index 15edd44..2be8bea 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,59 +1,30 @@
-
-
- INNcom 清单生成器
-
-
-
+
diff --git a/src/api/api.js b/src/api/api.js
index 4bfca97..d41008a 100644
--- a/src/api/api.js
+++ b/src/api/api.js
@@ -1,9 +1,8 @@
import axios from "axios";
-import { pathMap, localGet, localRemove } from '@/utils';
+import { localGet, localRemove } from '@/utils';
axios.defaults.withCredentials = true;
import { ElMessage } from "element-plus";
import router from "@/router/index";
-// 请求头,headers 信息
axios.defaults.headers["X-Requested-With"] = "XMLHttpRequest";
axios.defaults.headers = {
name: localGet('name'),
@@ -15,8 +14,7 @@ axios.defaults.headers = {
// 请求拦截器,内部根据返回值,重新组装,统一管理。
axios.interceptors.response.use(
(res) => {
- console.log(111,res);
- if(res.data.code === 2001) {
+ if(res.data.code === 2001||res.data.code === 2002) {
ElMessage.error(res.data.message || "401 Unauthorized");
router.push({ path: "/login" });
localRemove('token');
@@ -37,17 +35,26 @@ export function postJsonRequest(url, params) {
method: "post",
url: url,
data: params,
- // responseType: 'arraybuffer',
headers: {
"Content-Type": "application/json",
},
});
}
+export function downloadRequest(url, params) {
+ return axios({
+ method: "post",
+ url: url,
+ data: params,
+ responseType: 'blob',
+ headers: {
+ "Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ },
+ });
+}
// get请求
export function getRequest(url, params) {
return axios({
method: "get",
- // responseType: 'arraybuffer',
params: {
...params,
},
diff --git a/src/api/myApi.js b/src/api/myApi.js
index bf7c6a4..a3946e7 100644
--- a/src/api/myApi.js
+++ b/src/api/myApi.js
@@ -1,13 +1,14 @@
import {
- getRequest,
- postJsonRequest,
- deleteRequest,
- putRequest
+ postJsonRequest,downloadRequest
} from './api.js';
const myApi = {
getProjects(params) {
return postJsonRequest('/api/honeywell/inncon/list/project', params);
+ },
+
+ download(params) {
+ return downloadRequest('/api/honeywell/inncon/list/project', params);
}
}
export default myApi;
diff --git a/src/utils/index.js b/src/utils/index.js
index 5e85449..ab985f1 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -17,8 +17,6 @@ export function localRemove(key) {
export const pathMap = {
login: '登录',
- home: 'INNcom 清单生成器',
- project: 'INNcom 清单生成器',
- room: 'INNcom 清单生成器',
- weather: 'INNcom 清单生成器',
+ home: '项目管理',
+ room: '房型管理',
}
\ No newline at end of file
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 3c9fa59..63bde8c 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,17 +1,28 @@
-
-
-
-
-
- {{ item.name }}
- {{ item.description }}
- 管理
- 编辑
- 删除
-
-
+
+
+
+ 项目管理
+ 退出
+
+
+
+
+
+
+
+
+ {{ item.name }}
+ {{ item.description }}
+ 管理
+ 编辑
+ 删除
+
+
+
+
+
@@ -54,11 +65,16 @@ import { Plus } from "@element-plus/icons-vue";
import { ElMessage, ElMessageBox } from "element-plus";
import myApi from "@/api/myApi.js";
import { useRouter } from 'vue-router'
-
+import { localRemove } from '@/utils';
const router = useRouter()
-const projects = ref([]);
+const logout = () => {
+ localRemove("name");
+ localRemove("token");
+ router.push('login');
+}
+const projects = ref([]);
const open_project = () => {
add_project_info.name = '';
@@ -85,7 +101,6 @@ const openUpdateDialog = (item) => {
update_project_info.name = item.name;
update_project_info.new_name = item.name;
update_project_info.description = item.description;
- update_project_info.content = item.content || null;
update_project_info.enable = true;
}
@@ -121,7 +136,6 @@ const update_project_info = reactive({
name: "",
new_name: "",
description: "",
- content: null,
});
const update_project = async () => {
@@ -219,5 +233,11 @@ onMounted(() => {
font-weight: 500;
}
+ .button_plus {
+ width: 150px;
+ height: 150px;
+ font-size: 72px;
+ }
+
}
diff --git a/src/views/Login.vue b/src/views/Login.vue
index fec1708..59bf2f8 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -6,7 +6,8 @@
登录
-
+
@@ -23,9 +24,7 @@
\ No newline at end of file
+