This commit is contained in:
sakuya 2021-05-06 22:39:16 +08:00
parent f510fb00e4
commit 2366eb4868
7 changed files with 33 additions and 16 deletions

View File

@ -34,6 +34,9 @@
"env": {
"node": true
},
"globals": {
"APP_CONFIG": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"

8
public/config.js Normal file
View File

@ -0,0 +1,8 @@
const APP_CONFIG = {
//标题
APP_NAME: "SCUI",
//版本号
APP_VER: "1.0",
//接口地址
API_URL: ""
}

View File

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Welcome to SCUI Admin</title>
<script src="config.js"></script>
</head>
<body>
<noscript>

View File

@ -12,7 +12,7 @@ import http from "@/utils/request";
const api = {
user: {
info: {
url: `${config.apiUrl}/json/user.json`,
url: `${config.API_URL}/json/user.json`,
name: "登录获取用户菜单和权限",
get: async function(){
return await http.get(this.url);
@ -21,7 +21,7 @@ const api = {
},
demo: {
select: {
url: `${config.apiUrl}/json/select.json`,
url: `${config.API_URL}/json/select.json`,
name: "下拉菜单数据",
get: async function(data){
return await http.get(this.url, data);
@ -29,7 +29,7 @@ const api = {
},
demolist: {
list: {
url: `${config.apiUrl}/json/list.json`,
url: `${config.API_URL}/json/list.json`,
name: "列表数据",
get: async function(data){
return await http.get(this.url, data);

View File

@ -1,14 +1,16 @@
module.exports = {
const DEFAULT_CONFIG = {
//标题
title: "SCUI",
APP_NAME: "SCUI",
//版本号
version: "1.0",
APP_VER: "0.0.0",
//接口地址
apiUrl: "",
//是否开启多标签
tags: true,
//布局
layout: "default",
//主题
theme: "default",
};
API_URL: ""
}
//如果有外部APP_CONFIG就合并
if(APP_CONFIG){
Object.assign(DEFAULT_CONFIG, APP_CONFIG)
}
module.exports = DEFAULT_CONFIG

View File

@ -4,7 +4,7 @@
<div class="login_body">
<div class="login-sidebox">
<div class="login-logo">
<i class="el-icon-platform-eleme"></i>SCUI
<i class="el-icon-platform-eleme"></i>{{appName}}
</div>
<div class="login-title">
<h2>面面俱到的中后台前端框架</h2>
@ -38,7 +38,7 @@
</div>
</div>
</div>
<div class="login-footer">© SCUI</div>
<div class="login-footer">© {{appName}} {{appVar}}</div>
</div>
</template>
@ -71,6 +71,8 @@
export default {
data() {
return {
appName: this.$CONFIG.APP_NAME,
appVar: this.$CONFIG.APP_VER,
ruleForm: {
user: "admin",
password: "admin",

View File

@ -12,6 +12,7 @@ module.exports = {
chainWebpack: config => {
// 移除 prefetch 插件
config.plugins.delete('preload');
config.plugins.delete('prefetch');
},