Commit 9400f471 by eternalcoder

gx

parent 740a261f
......@@ -7,13 +7,14 @@ import {
formatParams1,
config
} from '@/utils/request'
import { baseUrl } from '@/config/index'
/**
* 查询列表
*/
export function getList(params) {
return api(Object.assign(formatParams('POST', params), {
url: `/admin-api/talent/getList`
url: `/admin-api/familyCode/queryList`
}))
}
......@@ -21,17 +22,26 @@ export function getList(params) {
* 查询详情
*/
export function get(params) {
return api(Object.assign(formatParams('POST', params), {
url: `/admin-api/talent/get`
return api(Object.assign(formatParams('GET', params), {
url: `/admin-api/familyCode/detail`
}))
}
/**
* 查询类型
*/
export function getType(params) {
return api1(Object.assign(formatParams1('GET', params), {
url: `${config.proxy}talent/getType?appId=1234`
export function getType() {
return api(Object.assign(formatParams('POST',), {
url: `${baseUrl}/admin-api/familyCode/queryZjCity`
}))
}
/**
* 查询状态
*/
export function getType1() {
return api(Object.assign(formatParams('POST'), {
url: `${baseUrl}/admin-api/familyCode/reviewState`
}))
}
......@@ -48,8 +58,8 @@ export function updateState(params) {
* 操作记录
*/
export function getRecord(params) {
return api1(Object.assign(formatParams1('POST', params), {
url: `${config.proxy}talent/getRecord`
return api(Object.assign(formatParams('GET', params), {
url: `${baseUrl}/admin-api/familyCode/queryRecordList`
}))
}
......
const domain = {
// dev: "http://192.168.3.144:8881", // 姚镇接口
// dev: "http://81.69.231.72:8881", // 测试接口
dev: "https://exam.smart-zj.cn:9100/smartExam/", // 新正式接口
// dev: "http://192.168.3.87:8881", // 姚镇接口
dev: "http://81.69.231.72:8881", // 测试接口
// dev: "https://exam.smart-zj.cn:9100/smartExam/", // 新正式接口
};
// 腾讯地图 key
const map = {
......
......@@ -7,8 +7,8 @@ const routes = [{
path: '/login',
name: 'login',
component: Login
},
{
},
{
path: "*",
name: "layout",
redirect: "/home",
......@@ -190,9 +190,16 @@ const routes = [{
meta: ['核酸采样结果'],
component: () => import('@/views/NucleicAcid/result.vue')
},
// 核酸采样结果
{
path: '/family-manage',
name: 'familyManage',
meta: ['家庭码'],
component: () => import('@/views/FamilyManage/index.vue')
},
]
},
},
]
const router = new VueRouter({
mode: 'hash',
......
......@@ -4,25 +4,45 @@
<span class="title">欢迎来到镇江管理后台</span>
<el-form class="form" :model="form" :rules="rules" ref="form">
<el-form-item label="账号" prop="account">
<el-input size="large" v-model="form.account" style="width: 80%" suffix-icon="el-icon-user">
<el-input
size="large"
v-model="form.account"
style="width: 80%"
suffix-icon="el-icon-user"
>
</el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" size="large" style="width: 80%" show-password></el-input>
<el-input
v-model="form.password"
size="large"
style="width: 80%"
show-password
></el-input>
</el-form-item>
<el-form-item label="验证码" prop="verification">
<div style="display: flex;">
<el-input v-model="form.verification" size="large" style="width: 54%"></el-input>
<div style="display: flex">
<el-input
v-model="form.verification"
size="large"
style="width: 54%"
></el-input>
<template>
<span @click="refreshCode" style="cursor: pointer;">
<span @click="refreshCode" style="cursor: pointer">
<Identify :identifyCode="identifyCode"></Identify>
</span>
</template>
</div>
</el-form-item>
<el-form-item class="fotter">
<el-button type="primary" v-loading.fullscreen.lock="fullscreenLoading" @click="login" size="large">
登录</el-button>
<el-button
type="primary"
v-loading.fullscreen.lock="fullscreenLoading"
@click="login"
size="large"
>
登录</el-button
>
</el-form-item>
</el-form>
</div>
......@@ -30,10 +50,10 @@
</template>
<script>
import { setToken, setMenuList } from "@/utils/auth.js";
import Identify from "./identify";
import { setToken, setMenuList } from '@/utils/auth.js';
import Identify from './identify';
// import md5 from "js-md5";
import { login, listMenus } from "@/api/login";
import { login, listMenus } from '@/api/login';
export default {
components: {
Identify,
......@@ -41,47 +61,52 @@ export default {
data() {
return {
form: {
account: "",
password: "",
verification: "",
account: '',
password: '',
verification: '',
},
rules: {
account: [{ required: true, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
verification: [{ required: true, message: "请输入验证码", trigger: "blur" }],
account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
verification: [
{ required: true, message: '请输入验证码', trigger: 'blur' },
],
},
// 图片验证码
identifyCode: '',
// 验证码规则
identifyCodes: '3456789ABCDEFGHGKMNPQRSTUVWXY',
fullscreenLoading: false
fullscreenLoading: false,
};
},
mounted() {
window.addEventListener("keydown", this.keyDown);
this.refreshCode()
},
created() {
window.addEventListener('keydown', this.keyDown);
this.refreshCode();
},
created() {},
methods: {
// 切换验证码
refreshCode() {
this.identifyCode = ''
this.makeCode(this.identifyCodes, 4)
this.identifyCode = '';
this.makeCode(this.identifyCodes, 4);
},
// 生成随机验证码
makeCode(o, l) {
for (let i = 0; i < l; i++) {
this.identifyCode += this.identifyCodes[
this.identifyCode +=
this.identifyCodes[
Math.floor(Math.random() * (this.identifyCodes.length - 0) + 0)
]
];
}
},
login() {
//测试账号 username:admin password:Admin@#!2022
this.$refs.form.validate((valid) => {
if (valid) {
if (this.form.verification.toLowerCase() === this.identifyCode.toLowerCase()) {
if (
this.form.verification.toLowerCase() ===
this.identifyCode.toLowerCase()
) {
this.fullscreenLoading = true;
// let password = md5(this.form.password);
let data = {
......@@ -95,28 +120,26 @@ export default {
localStorage.setItem('userName', res.data.userName),
listMenus({ tokenValue: res.data.tokenValue }).then((res) => {
if (res.success == true) {
console.log(res)
console.log(res);
setMenuList(JSON.stringify(res.data));
this.$router.push({ path: "/home" });
this.$message.success("登陆成功~");
this.$router.push({ path: '/home' });
this.$message.success('登陆成功~');
} else {
this.$message.error(res.msg || "登陆失败!");
this.refreshCode()
this.$message.error(res.msg || '登陆失败!');
this.refreshCode();
}
})
});
} else {
this.$message.error(res.msg || "登陆失败!");
this.refreshCode()
this.$message.error(res.msg || '登陆失败!');
this.refreshCode();
}
});
} else {
this.$message.error("请输入正确的验证码!");
this.refreshCode()
this.$message.error('请输入正确的验证码!');
this.refreshCode();
}
}
else {
this.refreshCode()
} else {
this.refreshCode();
return false;
}
});
......@@ -129,7 +152,7 @@ export default {
},
},
destroyed() {
window.removeEventListener("keydown", this.keyDown, false);
window.removeEventListener('keydown', this.keyDown, false);
},
};
</script>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment