加密处理

master
许宏杰 3 months ago
parent 0cd2b5f723
commit 7c2567e55a

@ -20,7 +20,12 @@
<!--引入mars3d库lib--> <!--引入mars3d库lib-->
<link href="./lib/mars3d/mars3d.css" rel="stylesheet" type="text/css" /> <link href="./lib/mars3d/mars3d.css" rel="stylesheet" type="text/css" />
<% if (process.env.NODE_ENV === 'production' ) { %>
<script src="./lib/mars3d/mars3d.js" type="text/javascript"></script> <script src="./lib/mars3d/mars3d.js" type="text/javascript"></script>
<% } else {%>
<script src="./lib/mars3d/mars3d-dev.js" type="text/javascript"></script>
<% } %>
<script src="./lib/localforage.js" type="text/javascript"></script> <script src="./lib/localforage.js" type="text/javascript"></script>
<script src="./lib/CesiumNetworkPlug.js" type="text/javascript"></script> <script src="./lib/CesiumNetworkPlug.js" type="text/javascript"></script>

@ -3,6 +3,7 @@ import { encrypt } from "@/utils/jsencrypt";
// 登录方法 // 登录方法
export function login(username, password, code, uuid) { export function login(username, password, code, uuid) {
username = encrypt(username); //加密
password = encrypt(password); //密码加密 password = encrypt(password); //密码加密
const data = { const data = {
username, username,
@ -21,12 +22,12 @@ export function login(username, password, code, uuid) {
}); });
} }
export function login2(username, password, code, uuid) { export function login2(username, password, code, uuid) {
password = encrypt(password); //密码加密
const data = { const data = {
username, username,
password, password,
code, code,
uuid, uuid,
app: "1",
}; };
return request({ return request({
url: "/loginnocaptcha", url: "/loginnocaptcha",

@ -5,6 +5,7 @@ import NProgress from "nprogress";
import "nprogress/nprogress.css"; import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { isRelogin } from "@/utils/request"; import { isRelogin } from "@/utils/request";
import { getLeaddata } from "@/utils/myFuntion";
NProgress.configure({ showSpinner: false }); NProgress.configure({ showSpinner: false });
@ -14,7 +15,7 @@ router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start();
if (to.path == "/xiaoqu" && to.query.isLeader && !getToken()) { if (to.path == "/xiaoqu" && to.query.isLeader && !getToken()) {
store store
.dispatch("login2", { username: "领导", password: "Loudong@2022***" }) .dispatch("login2", getLeaddata())
.then((res) => { .then((res) => {
handelRouter(to, from, next); handelRouter(to, from, next);
}) })
@ -24,7 +25,6 @@ router.beforeEach((to, from, next) => {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页 next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
}); });
}); });
return; return;
} }
handelRouter(to, from, next); handelRouter(to, from, next);

@ -1,6 +1,7 @@
import postcss from "../../postcss.config"; import postcss from "../../postcss.config";
import store from "@/store"; import store from "@/store";
import axios from "axios"; import axios from "axios";
import { encrypt } from "@/utils/jsencrypt";
export function pxToVw(size) { export function pxToVw(size) {
return ( return (
@ -118,4 +119,10 @@ export async function getSb(data) {
); );
console.log(res, "社保"); console.log(res, "社保");
} }
// 查询社保
export function getLeaddata() {
return {
username: encrypt("领导"),
password: encrypt("Loudong@2022***"),
};
}

@ -38,7 +38,7 @@
:key="'rows' + index" :key="'rows' + index"
> >
<div class="table-cell0">{{ index + 1 }}</div> <div class="table-cell0">{{ index + 1 }}</div>
<div class="table-cell1">{{ item.pname }}</div> <div class="table-cell1">{{ item.name }}</div>
<div class="table-cell1">{{ item.credentialNo }}</div> <div class="table-cell1">{{ item.credentialNo }}</div>
<div class="table-cell1">{{ item.phone }}</div> <div class="table-cell1">{{ item.phone }}</div>
<!-- <div class="table-cell2"> <!-- <div class="table-cell2">

Loading…
Cancel
Save