| | |
| | | "vue": "2.6.12", |
| | | "vue-count-to": "1.0.13", |
| | | "vue-cropper": "0.5.5", |
| | | "vue-drag-verify": "^1.0.6", |
| | | "vue-meta": "2.4.0", |
| | | "vue-router": "3.4.9", |
| | | "vuedraggable": "2.24.3", |
| | |
| | | }, |
| | | { |
| | | path: '/login', |
| | | component: () => import('@/views/login'), |
| | | component: () => import('@/views/user/login'), |
| | | hidden: true |
| | | }, |
| | | { |
| | |
| | | <template> |
| | | <iframe ref="iframe" :src="url" scrolling="auto" :style="{height:'calc(100% - 5px)',width:'100%',border:'none'}" /> |
| | | <div class="report-box"> |
| | | <iframe id="iframe-box" @load="loadFrame" ref="iframe" :src="url" scrolling="auto" :style="{height:'100%',width:'100%',border:'none'}" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | let token = getToken(); |
| | | this.url = globalConf.baseUrl + `/jmreport/view/ff9bd143582a6dfed897ba8b6f93b175?token=${token}` |
| | | this.height = window.screen.availHeight |
| | | }, |
| | | methods:{ |
| | | loadFrame() { |
| | | const iframeBox = document.getElementById('iframe-box') |
| | | const doc = iframeBox.contentWindow.document |
| | | const head = doc.getElementsByTagName('head') |
| | | const linkTag = document.createElement('link') |
| | | linkTag.id = 'newstyle' |
| | | linkTag.href = `./iframe.css` |
| | | linkTag.setAttribute('rel', 'stylesheet') |
| | | linkTag.setAttribute('type', 'text/css') |
| | | head[0].append(linkTag) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style lang="scss"> |
| | | .report-box{ |
| | | height: calc( 100vh - 150px ); |
| | | } |
| | | </style> |
New file |
| | |
| | | .jm-sheet-sheet{ |
| | | padding-left: 20px!important; |
| | | } |
| | |
| | | <template> |
| | | <iframe ref="iframe" :src="url" scrolling="auto" :style="{height:'calc(100% - 5px)',width:'100%',border:'none'}" /> |
| | | <div class="report-box"> |
| | | <iframe ref="iframe" :src="url" scrolling="auto" :style="{height:'100%',width:'100%',border:'none'}" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style lang="scss"> |
| | | .report-box{ |
| | | height: calc( 100vh - 150px ); |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <drag-verify |
| | | :width="width" |
| | | :height="height" |
| | | :text="text" |
| | | :success-text="successText" |
| | | :background="background" |
| | | :progress-bar-bg="progressBarBg" |
| | | :completed-bg="completedBg" |
| | | :handler-bg="handlerBg" |
| | | :handler-icon="handlerIcon" |
| | | :text-size="textSize" |
| | | :success-icon="successIcon" |
| | | @passcallback="passcallback2" |
| | | ref="Verify" |
| | | > |
| | | </drag-verify> |
| | | </template> |
| | | <script> |
| | | |
| | | import dragVerify from 'vue-drag-verify' |
| | | import 'font-awesome/css/font-awesome.min.css' |
| | | export default { |
| | | name: 'DragVerify', |
| | | components: { |
| | | dragVerify |
| | | }, |
| | | data () { |
| | | return { |
| | | handlerIcon: 'fa fa-angle-double-right', |
| | | successIcon: 'fa fa-check', |
| | | background: '#f5f5f5', |
| | | progressBarBg: 'rgba(71,141,251,0.5)', |
| | | completedBg: '#1890ff', |
| | | handlerBg: '#fff', |
| | | text: '请将滑块拖动到右侧', |
| | | successText: '验证成功', |
| | | width: 350, |
| | | height: 45, |
| | | textSize: '14px', |
| | | isCircle: 'true' |
| | | } |
| | | }, |
| | | methods: { |
| | | passcallback2 () { |
| | | if (this.$refs.Verify.isPassing) { |
| | | this.$emit('success') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .drag_verify .dv_handler_bg{ |
| | | width: 45px!important; |
| | | height: 45px!important; |
| | | } |
| | | </style> |
File was renamed from src/views/login.vue |
| | |
| | | <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code" v-if="captchaEnabled"> |
| | | <el-input |
| | | v-model="loginForm.code" |
| | | auto-complete="off" |
| | | placeholder="验证码" |
| | | style="width: 63%" |
| | | @keyup.enter.native="handleLogin" |
| | | > |
| | | <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> |
| | | </el-input> |
| | | <div class="login-code"> |
| | | <img :src="codeUrl" @click="getCode" class="login-code-img"/> |
| | | </div> |
| | | <el-form-item> |
| | | <!-- <el-input--> |
| | | <!-- v-model="loginForm.code"--> |
| | | <!-- auto-complete="off"--> |
| | | <!-- placeholder="验证码"--> |
| | | <!-- style="width: 63%"--> |
| | | <!-- @keyup.enter.native="handleLogin"--> |
| | | <!-- >--> |
| | | <!-- <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />--> |
| | | <!-- </el-input>--> |
| | | <!-- <div class="login-code">--> |
| | | <!-- <img :src="codeUrl" @click="getCode" class="login-code-img"/>--> |
| | | <!-- </div>--> |
| | | <drag-verify @success="verifyTrue" ref="verify"/> |
| | | </el-form-item> |
| | | <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> |
| | | <el-form-item style="width:100%;"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCodeImg } from "@/api/login"; |
| | | import dragVerify from './dragVerify/index.vue'// 滑动验证组件 |
| | | import Cookies from "js-cookie"; |
| | | import { encrypt, decrypt } from '@/utils/jsencrypt' |
| | | |
| | | export default { |
| | | name: "Login", |
| | | components: { |
| | | 'drag-verify': dragVerify |
| | | }, |
| | | data() { |
| | | return { |
| | | verify:false, |
| | | codeUrl: "", |
| | | loginForm: { |
| | | username: "", |
| | | password: "", |
| | | username: "supervisor", |
| | | password: "123456", |
| | | rememberMe: false, |
| | | code: "", |
| | | uuid: "" |
| | | }, |
| | | loginRules: { |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getCode(); |
| | | // this.getCode(); |
| | | this.getCookie(); |
| | | }, |
| | | methods: { |
| | | verifyTrue () { |
| | | this.verify = true |
| | | }, |
| | | getCode() { |
| | | getCodeImg().then(res => { |
| | | // console.log(res); |
| | |
| | | handleLogin() { |
| | | this.$refs.loginForm.validate(valid => { |
| | | if (valid) { |
| | | if (!this.verify) { |
| | | this.$message.error('请先完成验证') |
| | | this.loading = false |
| | | return |
| | | } |
| | | this.loading = true; |
| | | if (this.loginForm.rememberMe) { |
| | | Cookies.set("username", this.loginForm.username, { expires: 30 }); |
| | |
| | | this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); |
| | | }).catch(() => { |
| | | this.loading = false; |
| | | if (this.captchaEnabled) { |
| | | this.getCode(); |
| | | } |
| | | // if (this.captchaEnabled) { |
| | | // this.getCode(); |
| | | // } |
| | | }); |
| | | } |
| | | }); |
| | |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; |
| | | background-image: url("../assets/images/login-background.jpg"); |
| | | background-image: url("../../assets/images/login-background.jpg"); |
| | | background-size: cover; |
| | | } |
| | | .title { |