Browse Source

配置文件修改

a1140836302 2 years ago
parent
commit
866bf2b470
6 changed files with 31 additions and 50 deletions
  1. 1 1
      .env.development
  2. 1 1
      .env.production
  3. 3 2
      src/utils/request.js
  4. 18 39
      src/views/login/index.vue
  5. 1 1
      src/views/permission/directive.vue
  6. 7 6
      vue.config.js

+ 1 - 1
.env.development

@@ -2,4 +2,4 @@
 ENV = 'development'
 
 # base api
-VUE_APP_BASE_API = '/api'
+VUE_APP_BASE_API = 'http://zk.li-ai.com.cn:8080/api'

+ 1 - 1
.env.production

@@ -3,4 +3,4 @@ ENV = 'production'
 
 # base api
 # VUE_APP_BASE_API = '/api'
-VUE_APP_BASE_API = "http://192.168.2.10:8080/api"
+VUE_APP_BASE_API = "/api"

+ 3 - 2
src/utils/request.js

@@ -4,8 +4,9 @@ import store from '@/store'
 import { tansParams } from '@/utils/zk'
 import httpurl from '../../vue.config'
 const service = axios.create({
-  baseURL: httpurl.devServer.proxy['/api'].target+'/api', // url = base url + request url
-  timeout: 5000 // request timeout
+  // baseURL: httpurl.devServer.proxy['/api'].target+'/api',
+  baseURL:process.env.VUE_APP_BASE_API,
+  timeout: 5000 
 })
 
 // request interceptor

+ 18 - 39
src/views/login/index.vue

@@ -4,28 +4,16 @@
       <h3 class="title">重卡换电智能站控系统</h3>
     </div>
     <div class="login-bg">
-      <el-form
-        ref="loginForm"
-        :model="loginForm"
-        :rules="loginRules"
-        class="login-form"
-        autocomplete="on"
-        label-position="left"
-      >
+      <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on"
+        label-position="left">
         <div class="login-list">
           <p>账号:</p>
           <el-form-item tabindex="1" prop="username">
             <span class="svg-container">
               <svg-icon icon-class="user" />
             </span>
-            <el-input
-              ref="username"
-              v-model="loginForm.username"
-              placeholder="请输入用户名"
-              name="Username"
-              type="text"
-              autocomplete="on"
-            />
+            <el-input ref="username" v-model="loginForm.username" placeholder="请输入用户名" name="Username" type="text"
+              autocomplete="on" />
           </el-form-item>
         </div>
         <div class="login-list">
@@ -34,33 +22,18 @@
             <span class="svg-container">
               <svg-icon icon-class="password" />
             </span>
-            <el-input
-              :key="passwordType"
-              ref="password"
-              v-model="loginForm.password"
-              :type="passwordType"
-              placeholder="请输入密码"
-              name="password"
-              autocomplete="on"
-              @keyup.native="checkCapslock"
-              @blur="capsTooltip = false"
-              @keyup.enter.native="handleLogin"
-            />
+            <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
+              placeholder="请输入密码" name="password" autocomplete="on" @keyup.native="checkCapslock"
+              @blur="capsTooltip = false" @keyup.enter.native="handleLogin" />
             <span class="show-pwd" @click="showPwd">
-              <svg-icon
-                :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
-              />
+              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
             </span>
           </el-form-item>
         </div>
         <div class="login-list">
-        <p></p>
-        <el-button
-          :loading="loading"
-          @click.native.prevent="handleLogin"
-          >登录</el-button
-        >
-      </div>
+          <p></p>
+          <el-button :loading="loading" @click.native.prevent="handleLogin">登录</el-button>
+        </div>
       </el-form>
     </div>
   </div>
@@ -205,6 +178,7 @@ $cursor: #fff;
       padding: 12px 5px 12px 15px;
       color: $light_gray;
       caret-color: $cursor;
+
       &:-webkit-autofill {
         box-shadow: 0 0 0px 1000px $bg inset !important;
         -webkit-text-fill-color: $cursor !important;
@@ -232,6 +206,7 @@ $light_gray: #eee;
   background-color: black;
   background-image: url("./assets/index.png");
   overflow: hidden;
+
   .login-bg {
     position: relative;
     width: 580px;
@@ -248,6 +223,7 @@ $light_gray: #eee;
       flex-direction: row;
       width: 400px;
       margin: 0 auto;
+
       p {
         font-size: 16px;
         color: white;
@@ -258,9 +234,11 @@ $light_gray: #eee;
       }
     }
   }
+
   .title-container {
     position: relative;
     top: 26vh;
+
     .title {
       font-size: 32px;
       color: $light_gray;
@@ -270,6 +248,7 @@ $light_gray: #eee;
       letter-spacing: 1px;
     }
   }
+
   .el-button {
     color: black;
     font-weight: 600;
@@ -323,7 +302,7 @@ $light_gray: #eee;
     display: inline-block;
   }
 
-  
+
 
   .show-pwd {
     position: absolute;

+ 1 - 1
src/views/permission/directive.vue

@@ -63,7 +63,7 @@
           <el-table-column
             prop="vehicleVin"
             label="车辆识别码"
-            width="150"
+            width="160"
           />
           <el-table-column
             prop="vehicleOdo"

+ 7 - 6
vue.config.js

@@ -10,6 +10,7 @@ module.exports = {
   outputDir: 'dist',
   assetsDir: 'static',
   lintOnSave: false,
+  
   productionSourceMap: false,
   devServer: {
     host: 'localhost',
@@ -21,20 +22,20 @@ module.exports = {
     },
     proxy: {
       '/api': {
-        target: `http://192.168.3.177:8080`,
-        // target: `http://172.16.12.146:8080`,
+        // target: `http://192.168.3.177:8080`,
+        target: `http://zk.li-ai.com.cn:8080`,
         ws: true,
         changeOrigin: true,
       },
       '/ws': {
-         target: `ws://192.168.3.177:8080/ws`,
-        // target: `ws://172.16.12.146:8080/ws`,
+        // target: `ws://192.168.3.177:8080/ws`,
+        target: `ws://zk.li-ai.com.cn:8080/ws`,
         ws: true,
         changeOrigin: true,
       },
       '/video':{
-        target: `ws://192.168.3.177:8082/`,
-        // target: `ws://172.16.12.146:8080/ws`,
+        // target: `ws://192.168.3.177:8082/`,
+        target: `ws://zk.li-ai.com.cn:8080/ws`,
         ws: true,
         changeOrigin: true,
       }