构建框架

This commit is contained in:
龙运模
2024-06-24 18:52:21 +08:00
commit 33942cbe95
328 changed files with 50716 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/**
* @description 自动import导入所有 api 模块
*/
const files = require.context('./model', false, /\.js$/)
const modules = {}
files.keys().forEach((key) => {
modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
})
export default modules
+12
View File
@@ -0,0 +1,12 @@
import config from "@/config";
import http from "@/utils/request";
export default {
token: {
url: `${config.API_URL}/user.login`,
name: "登录获取TOKEN",
post: async function (data = {}) {
return await http.post(this.url, data);
},
},
};
+49
View File
@@ -0,0 +1,49 @@
import config from "@/config"
import http from "@/utils/request"
export default {
upload: {
url: `${config.API_URL}/upload`,
name: "文件上传",
post: async function(data, config={}){
return await http.post(this.url, data, config);
}
},
uploadFile: {
url: `${config.API_URL}/uploadFile`,
name: "附件上传",
post: async function(data, config={}){
return await http.post(this.url, data, config);
}
},
exportFile: {
url: `${config.API_URL}/fileExport`,
name: "导出附件",
get: async function(data, config={}){
return await http.get(this.url, data, config);
}
},
importFile: {
url: `${config.API_URL}/fileImport`,
name: "导入附件",
post: async function(data, config={}){
return await http.post(this.url, data, config);
}
},
file: {
menu: {
url: `${config.API_URL}/file/menu`,
name: "获取文件分类",
get: async function(){
return await http.get(this.url);
}
},
list: {
url: `${config.API_URL}/file/list`,
name: "获取文件列表",
get: async function(params){
return await http.get(this.url, params);
}
}
}
}
+59
View File
@@ -0,0 +1,59 @@
import config from "@/config";
import http from "@/utils/request";
export default {
ver: {
url: `${config.API_URL}/sys.ver`,
name: "获取最新版本号",
get: async function (params) {
return await http.get(this.url, params);
},
},
post: {
url: `${config.API_URL}/demo/post`,
name: "分页列表",
post: async function (data) {
return await http.post(this.url, data, {
headers: {
//'response-status': 401
},
});
},
},
page: {
url: `${config.API_URL}/demo/page`,
name: "分页列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
list: {
url: `${config.API_URL}/demo/list`,
name: "数据列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
menu: {
url: `${config.API_URL}/demo/menu`,
name: "普通用户菜单",
get: async function () {
return await http.get(this.url);
},
},
status: {
url: `${config.API_URL}/demo/status`,
name: "模拟无权限",
get: async function (code) {
return await http.get(
this.url,
{},
{
headers: {
"response-status": code,
},
}
);
},
},
};
+114
View File
@@ -0,0 +1,114 @@
import config from "@/config";
import http from "@/utils/request";
export default {
menu: {
myMenus: {
url: `${config.API_URL}/sys.menu`,
name: "获取我的菜单",
get: async function () {
return await http.get(this.url);
},
},
list: {
url: `${config.API_URL}/system/menu/list`,
name: "获取菜单",
get: async function () {
return await http.get(this.url);
},
},
},
dic: {
tree: {
url: `${config.API_URL}/system/dic/tree`,
name: "获取字典树",
get: async function () {
return await http.get(this.url);
},
},
list: {
url: `${config.API_URL}/system/dic/list`,
name: "字典明细",
get: async function (params) {
return await http.get(this.url, params);
},
},
get: {
url: `${config.API_URL}/system/dic/get`,
name: "获取字典数据",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
role: {
list: {
url: `${config.API_URL}/system/role/list2`,
name: "获取角色列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
dept: {
list: {
url: `${config.API_URL}/system/dept/list`,
name: "获取部门列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
user: {
list: {
url: `${config.API_URL}/system/user/list`,
name: "获取用户列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
app: {
list: {
url: `${config.API_URL}/system/app/list`,
name: "应用列表",
get: async function () {
return await http.get(this.url);
},
},
},
log: {
list: {
url: `${config.API_URL}/system/log/list`,
name: "日志列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
table: {
list: {
url: `${config.API_URL}/system/table/list`,
name: "表格列管理列表",
get: async function (params) {
return await http.get(this.url, params);
},
},
info: {
url: `${config.API_URL}/system/table/info`,
name: "表格列管理详情",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
tasks: {
list: {
url: `${config.API_URL}/system/tasks/list`,
name: "系统任务管理",
get: async function (params) {
return await http.get(this.url, params);
},
},
},
};