''
liukangdong
2024-07-04 5a85dcab83e969d6b21c599b512a15117e9b8651
admin/src/views/login.vue
@@ -1,7 +1,7 @@
<template>
  <div class="wrap">
    <div class="introduce">
      <h2>豆米跳跳</h2>
      <h2>{{title}}</h2>
      <h3></h3>
    </div>
    <div class="login">
@@ -23,12 +23,14 @@
<script>
import { mapMutations } from 'vuex'
import { getCaptcha, loginByPassword } from '@/api/system/common'
import Cookies from "js-cookie";
export default {
  name: 'Login',
  data () {
    return {
      loading: false,
      title: process.env.VUE_APP_TITLE,
      username: '',
      password: '',
      // 验证码
@@ -57,13 +59,14 @@
        code: this.captcha.value.trim(),
        uuid: this.captcha.uuid
      })
        .then(() => {
         // window.location.href = process.env.VUE_APP_CONTEXT_PATH
        .then((res) => {
          // window.location.href = process.env.VUE_APP_CONTEXT_PATH
          Cookies.set('dm_user_token',res)
          window.location.reload()
        })
        .catch(e => {
          this.refreshCaptcha()
          this.$tip.apiFailed(e)
          // this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.loading = false