From 3a82aab402e8cdee192ab47405f2a01973bd4dab Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 11 Apr 2022 11:46:25 +0800
Subject: [PATCH] 文件存储地址修改
---
src/page/login/codelogin.vue | 250 ++++++++++++++++++++++++++-----------------------
1 files changed, 131 insertions(+), 119 deletions(-)
diff --git a/src/page/login/codelogin.vue b/src/page/login/codelogin.vue
index bd6bc6d..3ddaf3a 100644
--- a/src/page/login/codelogin.vue
+++ b/src/page/login/codelogin.vue
@@ -1,93 +1,93 @@
<template>
- <el-form class="login-form"
- status-icon
- :rules="loginRules"
- ref="loginForm"
- :model="loginForm"
- label-width="0">
+ <el-form
+ class="login-form"
+ status-icon
+ :rules="loginRules"
+ ref="loginForm"
+ :model="loginForm"
+ label-width="0"
+ >
<el-form-item prop="username">
- <el-input size="small"
- @keyup.enter.native="handleLogin"
- v-model="loginForm.username"
- auto-complete="off"
- :placeholder="$t('login.username')">
- <i slot="prefix" class="icon-yonghu"/>
- </el-input>
- </el-form-item>
- <el-form-item prop="password">
- <el-input size="small"
- @keyup.enter.native="handleLogin"
- v-model="loginForm.password"
- auto-complete="off"
- show-password
- :placeholder="$t('login.password')">
- <i slot="prefix" class="icon-mima"/>
- </el-input>
- </el-form-item>
- <el-form-item prop="password2">
- <el-input size="small"
- @keyup.enter.native="handleLogin"
- v-model="loginForm.password2"
- auto-complete="off"
- show-password
- :placeholder="$t('login.password2')">
- <i slot="prefix" class="icon-mima"/>
- </el-input>
- </el-form-item>
- <el-form-item prop="sname">
- <el-input size="small"
- @keyup.enter.native="handleLogin"
- v-model="loginForm.sname"
- auto-complete="off"
- :placeholder="$t('login.name')">
- <i slot="prefix" class="icon-yonghu"/>
+ <el-input
+ size="small"
+ @keyup.enter.native="handleLogin"
+ v-model="loginForm.username"
+ auto-complete="off"
+ :placeholder="$t('login.username')"
+ >
+ <i slot="prefix" class="icon-yonghu" />
</el-input>
</el-form-item>
<el-form-item prop="phone">
- <el-input size="small"
- v-model="loginForm.phone"
- auto-complete="off"
- :placeholder="$t('login.phone')">
- <i slot="prefix" class="icon-shouji"/>
+ <el-input
+ size="small"
+ @keyup.enter.native="handleLogin"
+ v-model="loginForm.phone"
+ auto-complete="off"
+ :placeholder="$t('login.phone')"
+ >
+ <i slot="prefix" class="el-icon-phone-outline" />
</el-input>
</el-form-item>
- <div style="margin-top: 16px">
- <el-radio v-model="loginForm.sex" label="1" border size="medium">男</el-radio>
- <el-radio v-model="loginForm.sex" label="2" border size="medium">女</el-radio>
- </div>
+ <el-form-item prop="password">
+ <el-input
+ size="small"
+ @keyup.enter.native="handleLogin"
+ v-model="loginForm.password"
+ auto-complete="off"
+ show-password
+ :placeholder="$t('login.password')"
+ >
+ <i slot="prefix" class="icon-mima" />
+ </el-input>
+ </el-form-item>
+ <el-form-item prop="password2">
+ <el-input
+ size="small"
+ @keyup.enter.native="handleLogin"
+ v-model="loginForm.password2"
+ auto-complete="off"
+ show-password
+ :placeholder="$t('login.password2')"
+ >
+ <i slot="prefix" class="icon-mima" />
+ </el-input>
+ </el-form-item>
<el-form-item class="z-login-submit-prv">
- <el-button size="small"
- type="primary"
- @click.native.prevent="handleLogin"
- class="z-login-submit">{{ $t('login.zc') }}
+ <el-button
+ size="small"
+ type="primary"
+ @click.native.prevent="handleLogin"
+ class="z-login-submit"
+ >{{ $t("login.zc") }}
</el-button>
- <el-button size="small"
- @click.native.prevent="gbs"
- class="z-login-submit">{{ $t('login.gb') }}
+ <el-button size="small" @click.native.prevent="gbs" class="z-login-submit"
+ >{{ $t("login.gb") }}
</el-button>
</el-form-item>
</el-form>
</template>
<script>
-import {isvalidatemobile} from "@/util/validate";
-import {mapGetters} from "vuex";
+import { isvalidatemobile } from "@/util/validate";
+import { mapGetters } from "vuex";
+import { zc } from "@/api/system/user";
export default {
name: "codelogin",
data() {
const validatePass = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请输入密码'));
+ if (value === "") {
+ callback(new Error("请输入密码"));
} else {
callback();
}
};
const validatePass2 = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请再次输入密码'));
+ if (value === "") {
+ callback(new Error("请再次输入密码"));
} else if (value !== this.loginForm.password) {
- callback(new Error('两次输入密码不一致!'));
+ callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
@@ -112,27 +112,28 @@
dic: [],
msgKey: false,
loginForm: {
- phone: "",
username: "",
- sname: "",
+ phone: "",
password: "",
- sex: null,
- deptid: '',
- password2: ""
+ password2: "",
},
- value: '',
+ value: "",
options: [],
loginRules: {
- phone: [{required: true, trigger: "blur", validator: validatePhone}],
- code: [{required: true, trigger: "blur", validator: validateCode}],
- password: [{required: true, validator: validatePass, trigger: 'blur'}],
- password2: [{required: true, validator: validatePass2, trigger: 'blur'}],
+ phone: [{ required: true, trigger: "blur", validator: validatePhone }],
+ code: [{ required: true, trigger: "blur", validator: validateCode }],
+ password: [
+ { required: true, validator: validatePass, trigger: "blur" },
+ ],
+ password2: [
+ { required: true, validator: validatePass2, trigger: "blur" },
+ ],
username: [
- {required: true, message: "请输入用户名", trigger: "blur"}
+ { required: true, message: "请输入用户名", trigger: "blur" },
],
},
passwordType: "password",
- passwordTypes: "password2"
+ passwordTypes: "password2",
};
},
created() {
@@ -145,15 +146,20 @@
return {
MSGINIT: this.$t("login.msgText"),
MSGSCUCCESS: this.$t("login.msgSuccess"),
- MSGTIME: 60
+ MSGTIME: 60,
};
- }
+ },
},
props: [],
methods: {
ergodicData(val) {
var arr = [];
- arr.push({label: val[0].title, value: val[0].value, id: val[0].id, parent_id: val[0].parent_id});
+ arr.push({
+ label: val[0].title,
+ value: val[0].value,
+ id: val[0].id,
+ parent_id: val[0].parent_id,
+ });
if (val.length > 1) {
val.forEach((item, index) => {
if (index > 0) {
@@ -163,21 +169,36 @@
if (item.parent_id == it.id) {
ind = false;
arrInd = i;
- return
+ return;
}
- })
+ });
if (ind == false) {
if (arr[arrInd].children && arr[arrInd].children.length > 0) {
- arr[arrInd].children.push({label: item.title, value: item.value, id: item.id, parent_id: item.parent_id});
+ arr[arrInd].children.push({
+ label: item.title,
+ value: item.value,
+ id: item.id,
+ parent_id: item.parent_id,
+ });
} else {
arr[arrInd].children = [];
- arr[arrInd].children.push({label: item.title, value: item.value, id: item.id, parent_id: item.parent_id});
+ arr[arrInd].children.push({
+ label: item.title,
+ value: item.value,
+ id: item.id,
+ parent_id: item.parent_id,
+ });
}
} else {
- arr.push({label: item.title, value: item.value, id: item.id, parent_id: item.parent_id});
+ arr.push({
+ label: item.title,
+ value: item.value,
+ id: item.id,
+ parent_id: item.parent_id,
+ });
}
}
- })
+ });
}
return arr;
@@ -187,36 +208,28 @@
this.$refs[formName].clearValidate();
},
refreshCode(row) {
- console.log(this.loginForm)
- inster(row).then(res => {
- this.loginForm.phone = ""
- this.loginForm.username = ""
- this.loginForm.sname = ""
- this.loginForm.sex = null
- this.loginForm.password = ""
- this.loginForm.password2 = ""
- this.loginForm.deptid = ""
+ zc(row.username, row.password, row.phone).then((res) => {
+ this.loginForm.username = "";
+ this.loginForm.phone = "";
+ this.loginForm.password = "";
+ this.loginForm.password2 = "";
this.$notify({
- title: '注册成功,待审核',
- type: 'warning'
+ title: "注册成功",
+ type: "warning",
});
- })
- var z = document.querySelector('.z');
- z.style.display = 'none';
- this.clearValidate('loginForm')
- this.clearValidate('loginForm')
+ });
+ var z = document.querySelector(".z");
+ z.style.display = "none";
+ this.clearValidate("loginForm");
+ this.clearValidate("loginForm");
},
gb() {
- this.loginForm.phone = ""
- this.loginForm.username = ""
- this.loginForm.sname = ""
- this.loginForm.sex = null
- this.loginForm.password = ""
- this.loginForm.password2 = ""
- this.loginForm.deptid = ""
- var zs = document.querySelector('.z');
- zs.style.display = 'none';
- this.clearValidate('loginForm')
+ this.loginForm.username = "";
+ this.loginForm.password = "";
+ this.loginForm.password2 = "";
+ var zs = document.querySelector(".z");
+ zs.style.display = "none";
+ this.clearValidate("loginForm");
},
handleSend() {
if (this.msgKey) return;
@@ -244,20 +257,19 @@
: (this.passwordType = "");
},
handleLogin() {
- this.$refs.loginForm.validate(valid => {
- console.log(valid)
+ this.$refs.loginForm.validate((valid) => {
+ console.log(valid);
if (valid) {
this.refreshCode(this.loginForm);
- this.message('dahsiofhiusa');
+ this.message("dahsiofhiusa");
return Promise.reject(new Error("注册成功,待审核"));
}
});
},
gbs() {
this.gb();
- }
- }
-
+ },
+ },
};
</script>
@@ -288,12 +300,12 @@
.z-login-submit {
flex: 1;
height: 45px;
- border: 1px solid #409EFF;
+ border: 1px solid #409eff;
background: none;
font-size: 18px;
letter-spacing: 2px;
font-weight: 300;
- color: #409EFF;
+ color: #409eff;
cursor: pointer;
font-family: "neo";
-webkit-transition: 0.25s;
--
Gitblit v1.9.3