490eacef00e5c10fb57691a720722b9f.json 7.4 KB

1
  1. {"remainingRequest":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\pages\\login.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\pages\\login.vue","mtime":1760164952963},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["\r\nimport Cookies from 'js-cookie'\r\nimport debounce from 'lodash/debounce'\r\nimport { messages } from '@/i18n'\r\nimport { getUUID } from '@/utils'\r\nexport default {\r\n data () {\r\n return {\r\n i18nMessages: messages,\r\n captchaPath: '',\r\n dataForm: {\r\n username: '',\r\n password: '',\r\n uuid: '',\r\n captcha: ''\r\n }\r\n }\r\n },\r\n computed: {\r\n dataRule () {\r\n return {\r\n username: [\r\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\r\n ],\r\n password: [\r\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\r\n ],\r\n captcha: [\r\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n created () {\r\n this.getCaptcha()\r\n },\r\n methods: {\r\n // 获取验证码\r\n getCaptcha () {\r\n this.dataForm.uuid = getUUID()\r\n this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`\r\n },\r\n // 表单提交\r\n dataFormSubmitHandle: debounce(function () {\r\n this.$refs['dataForm'].validate((valid) => {\r\n if (!valid) {\r\n return false\r\n }\r\n this.$http.post('/login', this.dataForm).then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n this.getCaptcha()\r\n return this.$message.error(res.msg)\r\n }\r\n Cookies.set('token', res.data.token)\r\n this.$router.replace({ name: 'home' })\r\n }).catch(() => {})\r\n })\r\n }, 1000, { 'leading': true, 'trailing': false })\r\n }\r\n}\r\n",{"version":3,"sources":["login.vue"],"names":[],"mappings":";AAuDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"login.vue","sourceRoot":"src/views/pages","sourcesContent":["<template>\r\n <div class=\"aui-wrapper aui-page__login\">\r\n <div class=\"aui-content__wrapper\">\r\n <main class=\"aui-content\">\r\n <div class=\"login-header\">\r\n <h2 class=\"login-brand\">{{ $t('brand.lg') }}</h2>\r\n </div>\r\n <div class=\"login-body\">\r\n <h3 class=\"login-title\">{{ $t('login.title') }}</h3>\r\n <el-form :model=\"dataForm\" :rules=\"dataRule\" ref=\"dataForm\" @keyup.enter.native=\"dataFormSubmitHandle()\" status-icon>\r\n <el-form-item prop=\"username\">\r\n <el-input v-model=\"dataForm.username\" :placeholder=\"$t('login.username')\">\r\n <span slot=\"prefix\" class=\"el-input__icon\">\r\n <svg class=\"icon-svg\" aria-hidden=\"true\"><use xlink:href=\"#icon-user\"></use></svg>\r\n </span>\r\n </el-input>\r\n </el-form-item>\r\n <el-form-item prop=\"password\">\r\n <el-input v-model=\"dataForm.password\" type=\"password\" :placeholder=\"$t('login.password')\">\r\n <span slot=\"prefix\" class=\"el-input__icon\">\r\n <svg class=\"icon-svg\" aria-hidden=\"true\"><use xlink:href=\"#icon-lock\"></use></svg>\r\n </span>\r\n </el-input>\r\n </el-form-item>\r\n <el-form-item prop=\"captcha\">\r\n <el-row :gutter=\"20\">\r\n <el-col :span=\"14\">\r\n <el-input v-model=\"dataForm.captcha\" :placeholder=\"$t('login.captcha')\">\r\n <span slot=\"prefix\" class=\"el-input__icon\">\r\n <svg class=\"icon-svg\" aria-hidden=\"true\"><use xlink:href=\"#icon-safetycertificate\"></use></svg>\r\n </span>\r\n </el-input>\r\n </el-col>\r\n <el-col :span=\"10\" class=\"login-captcha\">\r\n <img :src=\"captchaPath\" @click=\"getCaptcha()\">\r\n </el-col>\r\n </el-row>\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button type=\"primary\" @click=\"dataFormSubmitHandle()\" class=\"w-percent-100\">{{ $t('login.title') }}</el-button>\r\n </el-form-item>\r\n </el-form>\r\n </div>\r\n <div class=\"login-footer\">\r\n <p>\r\n <a href=\"https://demo.renren.io/security-enterprise\" target=\"_blank\">{{ $t('login.demo') }}</a>\r\n </p>\r\n <p><a href=\"https://www.renren.io/\" target=\"_blank\">{{ $t('login.copyright') }}</a>2019 © renren.io</p>\r\n </div>\r\n </main>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Cookies from 'js-cookie'\r\nimport debounce from 'lodash/debounce'\r\nimport { messages } from '@/i18n'\r\nimport { getUUID } from '@/utils'\r\nexport default {\r\n data () {\r\n return {\r\n i18nMessages: messages,\r\n captchaPath: '',\r\n dataForm: {\r\n username: '',\r\n password: '',\r\n uuid: '',\r\n captcha: ''\r\n }\r\n }\r\n },\r\n computed: {\r\n dataRule () {\r\n return {\r\n username: [\r\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\r\n ],\r\n password: [\r\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\r\n ],\r\n captcha: [\r\n { required: true, message: this.$t('validate.required'), trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n created () {\r\n this.getCaptcha()\r\n },\r\n methods: {\r\n // 获取验证码\r\n getCaptcha () {\r\n this.dataForm.uuid = getUUID()\r\n this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`\r\n },\r\n // 表单提交\r\n dataFormSubmitHandle: debounce(function () {\r\n this.$refs['dataForm'].validate((valid) => {\r\n if (!valid) {\r\n return false\r\n }\r\n this.$http.post('/login', this.dataForm).then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n this.getCaptcha()\r\n return this.$message.error(res.msg)\r\n }\r\n Cookies.set('token', res.data.token)\r\n this.$router.replace({ name: 'home' })\r\n }).catch(() => {})\r\n })\r\n }, 1000, { 'leading': true, 'trailing': false })\r\n }\r\n}\r\n</script>\r\n"]}]}