MrShi
2025-12-16 66510450a254daed07b97cc10698cb1a228d716f
优化
已修改3个文件
182 ■■■■ 文件已修改
admin/.env.development 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/common/CommonHeader.vue 130 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/login.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/.env.development
@@ -5,11 +5,9 @@
#VUE_APP_API_URL  = 'http://192.168.1.45:10010'
# #VUE_APP_API_URL  = 'http://192.168.0.7/system_gateway'
VUE_APP_API_URL  = 'http://192.168.0.7/system_gateway'
# VUE_APP_API_URL  = 'http://localhost:10010'
# VUE_APP_API_URL  = 'https://atwl.ahzyssl.com/zhyq_interface'
#key:045542fc5f436b75e6c911c5c84ff8cd
#密钥:8bd38497f9aee2b75e7a888a4dfd1e6c
admin/src/components/common/CommonHeader.vue
@@ -10,18 +10,48 @@
        </div>
      </div>
      <div class="user">
        <el-dropdown v-if="isLogined" trigger="click">
          <span class="el-dropdown-link">
            <!-- <img v-if="userInfo != null" :src="userInfo.avatar == null ? `${require('@/assets/avatar/man.png')}` : userInfo.avatar" alt="">{{userInfo | displayName}}<i class="el-icon-arrow-down el-icon--right"></i> -->
            <img v-if="userInfo != null" style="width: 30px !important" src="@/assets/avatar/man.png" alt="" />{{
              userInfo | displayName
            }}<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item @click.native="changePwd">修改密码</el-dropdown-item>
            <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
          <div class="user-search">
              <div class="user-search-left">
                <span>全部</span>
                  <img src="@/assets/icons/xl.png" alt="">
              </div>
              <div class="user-search-right">
                  <input type="text" placeholder="请输入" />
                  <img src="@/assets/icons/sousuo.png" alt="">
              </div>
          </div>
          <div class="user-images">
              <img src="@/assets/icons/ic_1.jpg" alt="">
              <img src="@/assets/icons/ic_2.png" alt="">
              <img src="@/assets/icons/ic_3.jpg" alt="">
              <img src="@/assets/icons/ic_4.jpg" alt="">
              <img src="@/assets/icons/ic_5.jpg" alt="">
              <img src="@/assets/icons/ic_6.jpg" alt="">
              <img src="@/assets/icons/ic_7.jpg" alt="">
              <img src="@/assets/icons/ic_8.jpg" alt="">
          </div>
          <el-dropdown v-if="isLogined" trigger="click">
            <span class="el-dropdown-link" style="cursor: pointer; color: rgba(255,255,255,.56);">
              {{ userInfo | displayName }}
              <i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item @click.native="changePwd">修改密码</el-dropdown-item>
              <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
<!--        <el-dropdown v-if="isLogined" trigger="click">-->
<!--          <span class="el-dropdown-link">-->
<!--            &lt;!&ndash; <img v-if="userInfo != null" :src="userInfo.avatar == null ? `${require('@/assets/avatar/man.png')}` : userInfo.avatar" alt="">{{userInfo | displayName}}<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i> &ndash;&gt;-->
<!--            <img v-if="userInfo != null" style="width: 30px !important" src="@/assets/avatar/man.png" alt="" />{{-->
<!--              userInfo | displayName-->
<!--            }}<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
<!--          </span>-->
<!--          <el-dropdown-menu slot="dropdown">-->
<!--            <el-dropdown-item @click.native="changePwd">修改密码</el-dropdown-item>-->
<!--            <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>-->
<!--          </el-dropdown-menu>-->
<!--        </el-dropdown>-->
      </div>
    </div>
    <!-- 修改密码 -->
@@ -373,15 +403,83 @@
  }
  .user {
    width: 152px;
    /*width: 152px;*/
    box-sizing: border-box;
    height: 56px;
    padding-right: 25px;
    background: url("../../assets/images/top_ic_bolang@2x.png") no-repeat;
    /*background: url("../../assets/images/top_ic_bolang@2x.png") no-repeat;*/
    flex-shrink: 0;
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    .user-search {
        width: 346px;
        height: 32px;
        border-radius: 30px;
        border: 1px solid rgba(255,255,255,.56);
        margin-right: 15px;
        display: flex;
        align-items: center;
        .user-search-left {
            flex-shrink: 0;
            width: 106px;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            span {
                font-size: 14px;
                font-weight: 400;
                color: rgba(255,255,255,.56);
                margin-right: 10px;
            }
            img {
                top: 0;
                margin: 0;
                width: 20px;
                height: 16px;
            }
        }
        .user-search-right {
            flex: 1;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding-right: 10px;
            box-sizing: border-box;
            input {
                flex: 1;
                height: 100%;
                font-size: 14px;
                font-weight: 400;
                color: rgba(255,255,255,.56);
                border: none;
                outline: none;
                background-color: rgba(0,0,0,0);
                &::placeholder {
                    color: rgba(255,255,255,.56);
                }
            }
            img {
                top: 0;
                margin: 0;
                width: 20px;
                height: 20px;
            }
        }
    }
    .user-images {
        height: 100%;
        display: flex;
        align-items: center;
        img {
            top: 0 !important;
            width: 24px;
            height: 24px;
            margin-right: 15px;
        }
    }
    .el-dropdown {
      top: 2px;
      color: #fff;
admin/src/views/login.vue
@@ -3,7 +3,7 @@
    <img src="@/assets/images/bg@2x.png" class="main_bg" alt="">
    <div class="login_wrap">
      <div class="login_img">
        <div class="h3" style="font-size: 30px; margin-bottom: 0;">{{password.title || ''}}</div>
        <div class="h3" style="font-size: 30px; margin-left: 140px; margin-bottom: 0;">芜湖烟草</div>
        <div class="h3">智慧物流园区安消一体化系统</div>
      </div>
      <div class="form_wrap">
@@ -73,23 +73,22 @@
</template>
<script>
import { mapMutations, mapState } from 'vuex'
import { getCaptcha, loginByPassword, sendSmsPost, loginByPhone, getSystemConfig } from '@/api/system/common'
import Cookies from 'js-cookie'
import { mapMutations } from 'vuex'
import { getCaptcha, loginByPassword, sendSmsPost, loginByPhone } from '@/api/system/common'
import Cookies from "js-cookie"
import { Message } from 'element-ui'
export default {
  name: 'Login',
  data () {
  data() {
    return {
      title: process.env.VUE_APP_TITLE,
      loading: false,
      isRemPsd: false,
      username: '',
      password: '',
      phone: '',
      downTime: 0,
      paramConfig:{},
      smsCode: '',
      activeTab: '0',
      // 验证码
@@ -101,31 +100,18 @@
      }
    }
  },
  computed: {
    ...mapState(['sysConfig'])
  },
  mounted () {
  mounted() {
    this.username = localStorage.getItem('username') || ''
    this.password = localStorage.getItem('password') || ''
    this.phone = localStorage.getItem('phone') || ''
    const isRemPsd = localStorage.getItem('isRemPsd') || false
    this.isRemPsd = JSON.parse(isRemPsd)
    this.refreshCaptcha()
    this.getSystemConfig()
  },
  methods: {
    ...mapMutations(['setUserInfo', 'setSysconfig']),
    getSystemConfig () {
      getSystemConfig()
        .then((res) => {
          if (res  ) {
            this.paramConfig  = res||{}
            this.setSysconfig(res)
          }
        })
    },
    ...mapMutations(['setUserInfo']),
    // 登录
    login () {
    login() {
      if (this.loading) {
        return
      }
@@ -181,8 +167,9 @@
          this.loading = false
        })
      }
    },
    getCode () {
    getCode() {
      console.log('getCode')
      const { phone } = this
      if (!phone || phone.length != 11) {
@@ -191,7 +178,7 @@
      sendSmsPost({ phone, type: 0 }).then(res => {
        Message.success('短信发送成功')
        this.downTime = 60
        const timer = setInterval(() => {
        let timer = setInterval(() => {
          if (this.downTime == 0) {
            return clearInterval(timer)
          }
@@ -199,11 +186,11 @@
        }, 1000)
      })
    },
    tabClick (val) {
    tabClick(val) {
      this.activeTab = val
    },
    // 刷新验证码
    refreshCaptcha () {
    refreshCaptcha() {
      this.captcha.loading = true
      getCaptcha()
        .then(data => {
@@ -220,7 +207,7 @@
        })
    },
    // 登录前验证
    __check () {
    __check() {
      if (this.username.trim() === '') {
        this.$tip.error('请输入用户名')
        return false
@@ -235,7 +222,7 @@
      }
      return true
    }
  }
  },
}
</script>
@@ -280,6 +267,7 @@
      height: 600px;
      background: url("../assets/images/login_img@2x.png");
      background-size: 100% 100%;
      padding-left: 40px;
      padding-top: 60px;
      .h2 {
@@ -290,14 +278,12 @@
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        text-align: center;
        width: 208px;
        display: flex;
        margin-bottom: 12px;
      }
      .h3 {
        text-align: center;
        font-size: 28px;
        font-weight: 700;
        color: #fff;