forked from mt-fe-group/mt-yd-ui
		
	add comments
This commit is contained in:
		@@ -15,6 +15,7 @@ export const messages = {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default new VueI18n({
 | 
			
		||||
  locale: Cookies.get('language') || 'zh-CN',
 | 
			
		||||
  // locale: Cookies.get('language') || 'zh-CN',
 | 
			
		||||
  locale: 'zh-CN', // 先默认中文
 | 
			
		||||
  messages
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
@@ -72,6 +72,7 @@ const router = new Router({
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
router.beforeEach((to, from, next) => {
 | 
			
		||||
  console.log('[*] === router beforeEach: ', to, from)
 | 
			
		||||
  // 添加动态(菜单)路由
 | 
			
		||||
  // 已添加或者当前路由为页面路由, 可直接访问
 | 
			
		||||
  if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,7 @@ export function getIconList () {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 树形数据转换
 | 
			
		||||
 * 树形数据转换,把扁平的数据,转换为树形结构的数据
 | 
			
		||||
 * @param {*} data
 | 
			
		||||
 * @param {*} id
 | 
			
		||||
 * @param {*} pid
 | 
			
		||||
 
 | 
			
		||||
@@ -89,8 +89,8 @@ export default {
 | 
			
		||||
        cancelButtonText: this.$t('cancel'),
 | 
			
		||||
        type: 'warning'
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        this.$http.post('/logout').then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 0) {
 | 
			
		||||
        this.$http.post('/doLogout').then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 200) {
 | 
			
		||||
            return this.$message.error(res.msg)
 | 
			
		||||
          }
 | 
			
		||||
          clearLoginInfo()
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@
 | 
			
		||||
                </span>
 | 
			
		||||
              </el-input>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            <el-form-item prop="captcha">
 | 
			
		||||
            <!-- <el-form-item prop="captcha">
 | 
			
		||||
              <el-row :gutter="20">
 | 
			
		||||
                <el-col :span="14">
 | 
			
		||||
                  <el-input v-model="dataForm.captcha" :placeholder="$t('login.captcha')">
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
                  <img :src="captchaPath" @click="getCaptcha()">
 | 
			
		||||
                </el-col>
 | 
			
		||||
              </el-row>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
            </el-form-item> -->
 | 
			
		||||
            <el-form-item>
 | 
			
		||||
              <el-button type="primary" @click="dataFormSubmitHandle()" class="w-percent-100">{{ $t('login.title') }}</el-button>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
@@ -55,7 +55,7 @@
 | 
			
		||||
<script>
 | 
			
		||||
import Cookies from 'js-cookie'
 | 
			
		||||
import debounce from 'lodash/debounce'
 | 
			
		||||
import { getUUID } from '@/utils'
 | 
			
		||||
// import { getUUID } from '@/utils'
 | 
			
		||||
export default {
 | 
			
		||||
  data () {
 | 
			
		||||
    return {
 | 
			
		||||
@@ -64,7 +64,7 @@ export default {
 | 
			
		||||
        username: 'admin',
 | 
			
		||||
        password: 'admin',
 | 
			
		||||
        uuid: '',
 | 
			
		||||
        captcha: ''
 | 
			
		||||
        // captcha: ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
@@ -77,14 +77,14 @@ export default {
 | 
			
		||||
        password: [
 | 
			
		||||
          { required: true, message: this.$t('validate.required'), trigger: 'blur' }
 | 
			
		||||
        ],
 | 
			
		||||
        captcha: [
 | 
			
		||||
          { required: true, message: this.$t('validate.required'), trigger: 'blur' }
 | 
			
		||||
        ]
 | 
			
		||||
        // captcha: [
 | 
			
		||||
        //   { required: true, message: this.$t('validate.required'), trigger: 'blur' }
 | 
			
		||||
        // ]
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created () {
 | 
			
		||||
    this.getCaptcha()
 | 
			
		||||
    // this.getCaptcha()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取验证码
 | 
			
		||||
@@ -99,8 +99,8 @@ export default {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
        this.$http.post('/login', this.dataForm).then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 0) {
 | 
			
		||||
            this.getCaptcha()
 | 
			
		||||
          if (res.code !== 200) {
 | 
			
		||||
            // this.getCaptcha()
 | 
			
		||||
            return this.$message.error(res.msg)
 | 
			
		||||
          }
 | 
			
		||||
          Cookies.set('token', res.data.token)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user