Commit 9400f471 by eternalcoder

gx

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