配置文件
This commit is contained in:
parent
907a128f96
commit
04a31d0e94
|
|
@ -1,8 +1,9 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
const merge = require('webpack-merge')
|
const merge = require('webpack-merge')
|
||||||
const prodEnv = require('./prod.env')
|
const prodEnv = require('./prod.env')
|
||||||
|
const testEnv = require('./test.env')
|
||||||
|
|
||||||
module.exports = merge(prodEnv, {
|
module.exports = merge(prodEnv, testEnv, {
|
||||||
NODE_ENV: '"development"',
|
NODE_ENV: '"development"',
|
||||||
BASE_API: '"http://localhost:8000"',
|
BASE_API: '"http://localhost:8000"',
|
||||||
// BASE_API: '"http://139.224.54.200:8888"'
|
// BASE_API: '"http://139.224.54.200:8888"'
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@ module.exports = {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
// BASE_API: '"http://139.224.54.200:8000"',
|
// BASE_API: '"http://139.224.54.200:8000"',
|
||||||
BASE_API: '"http://139.224.54.200:8888"',
|
BASE_API: '"http://139.224.54.200:8888"',
|
||||||
|
NAME: '"生产"'
|
||||||
// BASE_API: '"http://139.224.57.82:8015"'
|
// BASE_API: '"http://139.224.57.82:8015"'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@ module.exports = {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
// BASE_API: '"http://139.224.54.200:8000"',
|
// BASE_API: '"http://139.224.54.200:8000"',
|
||||||
// BASE_API: '"http://139.224.54.200:8888"',
|
// BASE_API: '"http://139.224.54.200:8888"',
|
||||||
BASE_API: '"http://139.224.57.82:8015"'
|
BASE_API: '"http://139.224.57.82:8015"',
|
||||||
|
NAME: '"测试"'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ const getters = {
|
||||||
socketApi: state => state.api.socketApi,
|
socketApi: state => state.api.socketApi,
|
||||||
imagesUploadApi: state => state.api.imagesUploadApi,
|
imagesUploadApi: state => state.api.imagesUploadApi,
|
||||||
baseApi: state => state.api.baseApi,
|
baseApi: state => state.api.baseApi,
|
||||||
|
name: state => state.api.name,
|
||||||
fileUploadApi: state => state.api.fileUploadApi,
|
fileUploadApi: state => state.api.fileUploadApi,
|
||||||
updateAvatarApi: state => state.api.updateAvatarApi,
|
updateAvatarApi: state => state.api.updateAvatarApi,
|
||||||
qiNiuUploadApi: state => state.api.qiNiuUploadApi,
|
qiNiuUploadApi: state => state.api.qiNiuUploadApi,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
const baseUrl = process.env.BASE_API
|
const baseUrl = process.env.BASE_API
|
||||||
|
const name = process.env.NAME
|
||||||
const api = {
|
const api = {
|
||||||
state: {
|
state: {
|
||||||
// 实时控制台
|
// 实时控制台
|
||||||
|
|
@ -16,7 +17,8 @@ const api = {
|
||||||
// 文件上传
|
// 文件上传
|
||||||
fileUploadApi: baseUrl + '/api/localStorage',
|
fileUploadApi: baseUrl + '/api/localStorage',
|
||||||
// baseUrl,
|
// baseUrl,
|
||||||
baseApi: baseUrl
|
baseApi: baseUrl,
|
||||||
|
name: name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px"
|
||||||
<h3 class="title">襄岳科技</h3>
|
class="login-form">
|
||||||
|
<h3 class="title">襄岳科技-{{ name }}</h3>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码" @keyup.enter.native="handleLogin">
|
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
||||||
|
@keyup.enter.native="handleLogin">
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="code">
|
<el-form-item prop="code">
|
||||||
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter.native="handleLogin">
|
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
|
||||||
|
@keyup.enter.native="handleLogin">
|
||||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
<div class="login-code">
|
<div class="login-code">
|
||||||
|
|
@ -22,7 +25,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住我</el-checkbox> -->
|
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住我</el-checkbox> -->
|
||||||
<el-form-item style="width:100%;">
|
<el-form-item style="width:100%;">
|
||||||
<el-button :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
|
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
|
||||||
|
@click.native.prevent="handleLogin">
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -40,8 +44,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { encrypt } from '@/utils/rsaEncrypt'
|
import { encrypt } from '@/utils/rsaEncrypt'
|
||||||
import Config from '@/config'
|
import Config from '@/config'
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
import { getCodeImg } from '@/api/login'
|
import { getCodeImg } from '@/api/login'
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -76,6 +82,11 @@ export default {
|
||||||
this.getCode()
|
this.getCode()
|
||||||
this.getCookie()
|
this.getCookie()
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
'name'
|
||||||
|
])
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
getCodeImg().then(res => {
|
getCodeImg().then(res => {
|
||||||
|
|
@ -148,6 +159,7 @@ export default {
|
||||||
background-image: url("../assets/imgs/login_bg.jpg");
|
background-image: url("../assets/imgs/login_bg.jpg");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin: 0px auto 30px auto;
|
margin: 0px auto 30px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -159,26 +171,34 @@ export default {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
width: 385px;
|
width: 385px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icon {
|
.input-icon {
|
||||||
height: 39px;width: 14px;margin-left: 2px;
|
height: 39px;
|
||||||
|
width: 14px;
|
||||||
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-tip {
|
.login-tip {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #bfbfbf;
|
color: #bfbfbf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-code {
|
.login-code {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle
|
vertical-align: middle
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user