|
|
@@ -1,20 +1,20 @@
|
|
|
<template>
|
|
|
- <div class="bgimg w-full h-full flex bg-black">
|
|
|
+ <div id="app" class="bgImg w-full h-full flex bg-black">
|
|
|
<div class=" w-8/12 h-full hidden md:flex justify-center items-center p-10 bg-blue-400 relative bg-map">
|
|
|
- <div class="w-full h-full bgimg absolute"></div>
|
|
|
+ <div class="w-full h-full bgImg absolute"></div>
|
|
|
<div class="w-full h-4/5 bottom-0 absolute flex items-center justify-center relative">
|
|
|
<div class="lbx absolute">
|
|
|
- <img src="/public/image/big/lbx.png" alt="lbx">
|
|
|
+ <img src="/image/big/lbx.png" alt="lbx">
|
|
|
</div>
|
|
|
|
|
|
<div class="jt absolute ">
|
|
|
- <img src="/public/image/big/jt.png" alt="背景图片">
|
|
|
+ <img src="/image/big/jt.png" alt="背景图片">
|
|
|
</div>
|
|
|
<div class="map absolute ">
|
|
|
- <img src="/public/image/big/map.png" alt="地球">
|
|
|
+ <img src="/image/big/map.png" alt="地球">
|
|
|
</div>
|
|
|
<div class="rounded-img absolute ">
|
|
|
- <img src="/public/image/big/rounded.png" alt="地球">
|
|
|
+ <img src="/image/big/rounded.png" alt="地球">
|
|
|
</div>
|
|
|
<div class="w-auto relative bottom-1/5">
|
|
|
<h1 class="text-7xl text-white">合方圆管理平台</h1>
|
|
|
@@ -26,7 +26,7 @@
|
|
|
</div>
|
|
|
<!-- 登陆框逻辑-->
|
|
|
<div class="w-full md:w-3/12 h-full flex justify-center md:justify-start items-center relative">
|
|
|
- <div class="blur w-full h-full absolute bg-blue-300 opacity-50 bgimg"></div>
|
|
|
+ <div class="blur w-full h-full absolute bg-blue-300 opacity-50 bgImg"></div>
|
|
|
<div class="login-box w-80 h-auto rounded px-0.5 text-gray-200 relative">
|
|
|
<h2 class="pt-2 text-xl">欢迎您,请登陆</h2>
|
|
|
|
|
|
@@ -63,7 +63,7 @@
|
|
|
<div class="w-full text-red-600" v-show="form.captcha.msg" >
|
|
|
{{form.captcha.msg}}
|
|
|
</div>
|
|
|
- <captcha class="w-full h-24 overflow-hidden mt-1.5 rounded" ref="captchaImg" captcha-url="/captcha/"></captcha>
|
|
|
+ <captcha class="w-full h-24 overflow-hidden mt-1.5 rounded" ref="captchaImg" captcha-url="/api/captcha/"></captcha>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -75,9 +75,9 @@
|
|
|
</div>
|
|
|
<div class="border-t px-2 ">
|
|
|
<span class="mr-4 text-blue-300" >
|
|
|
- <a href="/register">立即注册</a>
|
|
|
+ <a href="/">备案号</a>
|
|
|
</span>
|
|
|
- <a href="/hfy_login">主站点</a>
|
|
|
+ <a href="/">首页</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -86,25 +86,42 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Captcha from "@components/user/captcha";
|
|
|
-import apis from '@/apis/apis'
|
|
|
-import handle from "@/utils/handle";
|
|
|
-import business from "@/utils/business";
|
|
|
-import LightButton from "@components/public/lightButton";
|
|
|
-import fieldIsAllow from "@/utils/fieldIsAllow"
|
|
|
-import userData from "@/saves/users";
|
|
|
+
|
|
|
+import Vue from 'vue'
|
|
|
+// 引用ant-design-vue的input组件
|
|
|
+import antInput from 'ant-design-vue/lib/input';
|
|
|
+import 'ant-design-vue/dist/antd.css'
|
|
|
+
|
|
|
+
|
|
|
+// import apis from '@/apis/apis'
|
|
|
+import handle from "~/until/handle";
|
|
|
+import business from "~/until/business";
|
|
|
+import fieldIsAllow from "~/until/fieldIsAllow"
|
|
|
+import userData from "~/until/saves/users";
|
|
|
+
|
|
|
+import Captcha from "~/components/public/captcha";
|
|
|
+import LightButton from "~/components/public/lightButton";
|
|
|
+import {login_types} from "../../store/login";
|
|
|
+
|
|
|
+Vue.use(antInput);
|
|
|
+
|
|
|
export default {
|
|
|
name: 'App',
|
|
|
components: {
|
|
|
LightButton,
|
|
|
- Captcha
|
|
|
+ Captcha,
|
|
|
+ },
|
|
|
+ async asyncData(ctx) {
|
|
|
+
|
|
|
},
|
|
|
beforeCreate() {
|
|
|
- // 修改页面title
|
|
|
- document.title = '合方圆-登陆';
|
|
|
+ // 修改页面title nuxt
|
|
|
+ // this.$store.commit('setPageTitle', '合方圆管理平台');
|
|
|
+
|
|
|
},
|
|
|
data(){
|
|
|
return {
|
|
|
+ test: 'test',
|
|
|
// 是否为固定
|
|
|
labelCol: { span: 4 },
|
|
|
wrapperCol: { span: 16 },
|
|
|
@@ -130,6 +147,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
+ captcha () {
|
|
|
+ return this.$store.state.login.captcha
|
|
|
+ }
|
|
|
},
|
|
|
beforeMount(){
|
|
|
},
|
|
|
@@ -138,8 +158,13 @@ export default {
|
|
|
if(url){
|
|
|
this.jumpUrl = url;
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
methods:{
|
|
|
+ setCaptcha(captcha){
|
|
|
+ // this.$store..commit(login_types.mutations.SET_CAPTCHA, captcha);
|
|
|
+ this.$store.commit('login/'+login_types.mutations.SET_CAPTCHA, captcha);
|
|
|
+ },
|
|
|
resetForm(){
|
|
|
this.form.owner = '';
|
|
|
this.form.password = '';
|
|
|
@@ -147,6 +172,8 @@ export default {
|
|
|
},
|
|
|
checkFormItem(field){
|
|
|
console.log(field);
|
|
|
+
|
|
|
+ this.setCaptcha(this.form[field].val);
|
|
|
if (field){
|
|
|
this.form[field].msg = fieldIsAllow({
|
|
|
[field]:this.form[field].val,
|
|
|
@@ -171,7 +198,12 @@ export default {
|
|
|
let owner = this.form.owner.val;
|
|
|
let passwd = this.form.password.val;
|
|
|
let captcha = this.form.captcha.val;
|
|
|
- let [err,response] = await handle(apis.user.login(owner,passwd,captcha));
|
|
|
+ // apis.user.login(owner,passwd,captcha)
|
|
|
+ let [err,response] = await handle(this.$axios.post('/api/user/login',{
|
|
|
+ owner,
|
|
|
+ passwd,
|
|
|
+ captcha,
|
|
|
+ }));
|
|
|
let rcodeMean = business.checkResponseRcode(response,err);
|
|
|
if(rcodeMean.ok){
|
|
|
let res = rcodeMean.res;
|
|
|
@@ -215,14 +247,14 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-body{
|
|
|
+html,body{
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
height: 100vh;
|
|
|
font-family: sans-serif;
|
|
|
}
|
|
|
-.bgimg{
|
|
|
- background: url("/public/image/big/bg.jpg") center no-repeat;
|
|
|
+.bgImg{
|
|
|
+ background: url("/image/big/bg.png") center no-repeat;
|
|
|
}
|
|
|
#app {
|
|
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
|
@@ -230,8 +262,8 @@ body{
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
text-align: center;
|
|
|
color: #2c3e50;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
}
|
|
|
.login-box{
|
|
|
transform: translate(-50%, -0%);
|