parent
77bc119c35
commit
5b78760ccb
|
@ -5,7 +5,7 @@
|
||||||
const APP_CONFIG = {
|
const APP_CONFIG = {
|
||||||
//标题
|
//标题
|
||||||
APP_NAME: "SCUI",
|
APP_NAME: "SCUI",
|
||||||
|
|
||||||
//接口地址
|
//接口地址,如遇跨域需使用nginx代理
|
||||||
API_URL: ""
|
API_URL: "https://www.fastmock.site/mock/44c807475f7eeba73409792255781935/api"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import http from "@/utils/request";
|
||||||
const api = {
|
const api = {
|
||||||
default: {
|
default: {
|
||||||
upload: {
|
upload: {
|
||||||
url: `${config.MOCK_URL}/upload`,
|
url: `${config.API_URL}/upload`,
|
||||||
name: "文件上传",
|
name: "文件上传",
|
||||||
post: async function(data){
|
post: async function(data){
|
||||||
return await http.post(this.url, data);
|
return await http.post(this.url, data);
|
||||||
|
@ -21,51 +21,51 @@ const api = {
|
||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
login: {
|
login: {
|
||||||
url: `${config.MOCK_URL}/login`,
|
url: `${config.API_URL}/login`,
|
||||||
name: "登录获取用户菜单和权限,全部权限",
|
name: "登录获取用户菜单和权限,全部权限",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
return await http.get(this.url);
|
return await http.get(this.url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
login_demo: {
|
login_demo: {
|
||||||
url: `${config.MOCK_URL}/login_user`,
|
url: `${config.API_URL}/login_user`,
|
||||||
name: "登录获取用户菜单和权限,部分权限",
|
name: "登录获取用户菜单和权限,部分权限",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
return await http.get(this.url);
|
return await http.get(this.url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
url: `${config.MOCK_URL}/user_list`,
|
url: `${config.API_URL}/user_list`,
|
||||||
name: "获取用户列表",
|
name: "获取用户列表",
|
||||||
get: async function(params={}){
|
get: async function(params={}){
|
||||||
return await http.get(this.url, params);
|
return await http.get(this.url, params);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
url: `${config.MOCK_URL}/post`,
|
url: `${config.API_URL}/post`,
|
||||||
name: "新增编辑用户",
|
name: "新增编辑用户",
|
||||||
post: async function(params={}){
|
post: async function(params={}){
|
||||||
return await http.get(this.url, params);
|
return await http.post(this.url, params);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
del: {
|
del: {
|
||||||
url: `${config.MOCK_URL}/post`,
|
url: `${config.API_URL}/post`,
|
||||||
name: "删除用户",
|
name: "删除用户",
|
||||||
post: async function(params={}){
|
post: async function(params={}){
|
||||||
return await http.get(this.url, params);
|
return await http.post(this.url, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
role: {
|
role: {
|
||||||
select: {
|
select: {
|
||||||
url: `${config.MOCK_URL}/role`,
|
url: `${config.API_URL}/role`,
|
||||||
name: "角色选择列表",
|
name: "角色选择列表",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
return await http.get(this.url);
|
return await http.get(this.url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
url: `${config.MOCK_URL}/role`,
|
url: `${config.API_URL}/role`,
|
||||||
name: "角色列表",
|
name: "角色列表",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
return await http.get(this.url);
|
return await http.get(this.url);
|
||||||
|
@ -74,14 +74,14 @@ const api = {
|
||||||
},
|
},
|
||||||
dic: {
|
dic: {
|
||||||
list: {
|
list: {
|
||||||
url: `${config.MOCK_URL}/dic_list`,
|
url: `${config.API_URL}/dic_list`,
|
||||||
name: "字典列表",
|
name: "字典列表",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
return await http.get(this.url);
|
return await http.get(this.url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
info: {
|
info: {
|
||||||
url: `${config.MOCK_URL}/dic_info`,
|
url: `${config.API_URL}/dic_info`,
|
||||||
name: "字典明细",
|
name: "字典明细",
|
||||||
get: async function(params){
|
get: async function(params){
|
||||||
return await http.get(this.url, params);
|
return await http.get(this.url, params);
|
||||||
|
@ -90,7 +90,7 @@ const api = {
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
list: {
|
list: {
|
||||||
url: `${config.MOCK_URL}/app`,
|
url: `${config.API_URL}/app`,
|
||||||
name: "应用列表",
|
name: "应用列表",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
return await http.get(this.url);
|
return await http.get(this.url);
|
||||||
|
@ -99,7 +99,7 @@ const api = {
|
||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
list: {
|
list: {
|
||||||
url: `${config.MOCK_URL}/login`,
|
url: `${config.API_URL}/login`,
|
||||||
name: "菜单管理",
|
name: "菜单管理",
|
||||||
get: async function(){
|
get: async function(){
|
||||||
// 这里接口对象偷懒重复了登录接口
|
// 这里接口对象偷懒重复了登录接口
|
||||||
|
@ -111,7 +111,7 @@ const api = {
|
||||||
},
|
},
|
||||||
log: {
|
log: {
|
||||||
list: {
|
list: {
|
||||||
url: `${config.MOCK_URL}/loglist`,
|
url: `${config.API_URL}/loglist`,
|
||||||
name: "日志列表",
|
name: "日志列表",
|
||||||
get: async function(params){
|
get: async function(params){
|
||||||
return await http.get(this.url, params);
|
return await http.get(this.url, params);
|
||||||
|
@ -120,14 +120,14 @@ const api = {
|
||||||
},
|
},
|
||||||
demo: {
|
demo: {
|
||||||
page: {
|
page: {
|
||||||
url: `${config.MOCK_URL}/page`,
|
url: `${config.API_URL}/page`,
|
||||||
name: "分页列表",
|
name: "分页列表",
|
||||||
get: async function(params){
|
get: async function(params){
|
||||||
return await http.get(this.url, params);
|
return await http.get(this.url, params);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
upload: {
|
upload: {
|
||||||
url: `${config.MOCK_URL}/upload`,
|
url: `${config.API_URL}/upload`,
|
||||||
name: "文件上传接口",
|
name: "文件上传接口",
|
||||||
post: async function(data){
|
post: async function(data){
|
||||||
return await http.post(this.url, data);
|
return await http.post(this.url, data);
|
||||||
|
|
|
@ -6,10 +6,7 @@ const DEFAULT_CONFIG = {
|
||||||
APP_VER: "1.1.16",
|
APP_VER: "1.1.16",
|
||||||
|
|
||||||
//接口地址
|
//接口地址
|
||||||
API_URL: "",
|
API_URL: "/api",
|
||||||
|
|
||||||
//MOCK接口地址
|
|
||||||
MOCK_URL: "https://www.fastmock.site/mock/44c807475f7eeba73409792255781935/api",
|
|
||||||
|
|
||||||
//TokenName
|
//TokenName
|
||||||
TOKEN_NAME: "Authorization",
|
TOKEN_NAME: "Authorization",
|
||||||
|
|
|
@ -7,9 +7,19 @@ module.exports = {
|
||||||
// build编译后不生成资源MAP文件
|
// build编译后不生成资源MAP文件
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
|
|
||||||
|
//开发服务,build后的生产模式还需nginx代理
|
||||||
devServer: {
|
devServer: {
|
||||||
open: false, //运行后自动打开游览器
|
open: false, //运行后自动打开游览器
|
||||||
port: 2800 //挂载端口
|
port: 2800, //挂载端口
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'https://www.fastmock.site/mock/44c807475f7eeba73409792255781935/api',
|
||||||
|
ws: true,
|
||||||
|
pathRewrite: {
|
||||||
|
'^/api': '/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
chainWebpack: config => {
|
chainWebpack: config => {
|
||||||
|
|
Loading…
Reference in New Issue