添加跳转路径
This commit is contained in:
parent
5672332366
commit
faf8c086a3
|
|
@ -215,15 +215,16 @@
|
||||||
const urlParam = new URLSearchParams(url.search);
|
const urlParam = new URLSearchParams(url.search);
|
||||||
const path = url.pathname; // 输出: "/page"
|
const path = url.pathname; // 输出: "/page"
|
||||||
const token = urlParam.get('token'); // 输出: "value1"
|
const token = urlParam.get('token'); // 输出: "value1"
|
||||||
|
let username=localStorage.getItem("public_username");
|
||||||
if(token){
|
if(token){
|
||||||
const params = {
|
const params = {
|
||||||
"username": token,
|
"username": encrypt(username),
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers:{
|
headers:{
|
||||||
"Authorization":public_token
|
"Authorization":public_token
|
||||||
},
|
},
|
||||||
url: request_url + 'czldp/publicLogin/defaultLogin',
|
url: request_url + '/czldp/publicLogin/defaultLogin',
|
||||||
data: JSON.stringify(params),
|
data: JSON.stringify(params),
|
||||||
async : true,
|
async : true,
|
||||||
method:"POST",
|
method:"POST",
|
||||||
|
|
|
||||||
|
|
@ -216,15 +216,16 @@
|
||||||
const urlParam = new URLSearchParams(url.search);
|
const urlParam = new URLSearchParams(url.search);
|
||||||
const path = url.pathname; // 输出: "/page"
|
const path = url.pathname; // 输出: "/page"
|
||||||
const token = urlParam.get('token'); // 输出: "value1"
|
const token = urlParam.get('token'); // 输出: "value1"
|
||||||
if(token){
|
let username=localStorage.getItem("public_username");
|
||||||
|
if(username){
|
||||||
const params = {
|
const params = {
|
||||||
"username": token,
|
"username": encrypt(username),
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers:{
|
headers:{
|
||||||
"Authorization":public_token
|
"Authorization":public_token
|
||||||
},
|
},
|
||||||
url: request_url + 'czl/publicLogin/defaultLogin',
|
url: request_url + '/czl/publicLogin/defaultLogin',
|
||||||
data: JSON.stringify(params),
|
data: JSON.stringify(params),
|
||||||
async : true,
|
async : true,
|
||||||
method:"POST",
|
method:"POST",
|
||||||
|
|
|
||||||
|
|
@ -202,10 +202,13 @@
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function addInfo(formData) {
|
function addInfo(formData) {
|
||||||
if (!phone_reg($("#phone").val())) {
|
if(id == ''){
|
||||||
layer.msg("手机号码错误,请仔细核对!", {icon: 0});
|
if (!phone_reg($("#phone").val())) {
|
||||||
return false;
|
layer.msg("手机号码错误,请仔细核对!", {icon: 0});
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($("#department").val() == "点击进行部门选择") {
|
if ($("#department").val() == "点击进行部门选择") {
|
||||||
layer.msg("请选择部门!", {icon: 0});
|
layer.msg("请选择部门!", {icon: 0});
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -209,11 +209,7 @@ export default {
|
||||||
uuid: "",
|
uuid: "",
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
// 验证码开关
|
|
||||||
captchaOnOff: true,
|
|
||||||
// 注册开关
|
|
||||||
register: false,
|
|
||||||
redirect: undefined,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -228,6 +224,7 @@ export default {
|
||||||
next(); // 必须调用next()来解决路由守卫的promise
|
next(); // 必须调用next()来解决路由守卫的promise
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
debugger
|
||||||
//平台单独的登录 2024年4月16日11:23:58
|
//平台单独的登录 2024年4月16日11:23:58
|
||||||
this.getLoginByNameAndTokenJ();
|
this.getLoginByNameAndTokenJ();
|
||||||
},
|
},
|
||||||
|
|
@ -236,7 +233,6 @@ export default {
|
||||||
* 只传递token
|
* 只传递token
|
||||||
*/
|
*/
|
||||||
getLoginByNameAndTokenJ() {
|
getLoginByNameAndTokenJ() {
|
||||||
|
|
||||||
debugger
|
debugger
|
||||||
console.log(window.location.href);
|
console.log(window.location.href);
|
||||||
let url=window.location.href.split("?");
|
let url=window.location.href.split("?");
|
||||||
|
|
@ -274,12 +270,12 @@ export default {
|
||||||
this.$store.dispatch("DefaultLogin", loginForm).then(() => {
|
this.$store.dispatch("DefaultLogin", loginForm).then(() => {
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
|
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// window.location.href = 'http://127.0.0.1:8848/hn_cloud_web/login.html';
|
window.location.href = 'http://127.0.0.1:8848/hn_cloud_web/login.html';
|
||||||
});
|
});
|
||||||
// this.$message.error("用户token为空");
|
// this.$message.error("用户token为空");
|
||||||
} else {
|
} else {
|
||||||
//本地环境
|
//本地环境
|
||||||
// window.location.href = 'http://127.0.0.1:8848/hn_cloud_web/login.html';
|
window.location.href = 'http://127.0.0.1:8848/hn_cloud_web/login.html';
|
||||||
// console.log("tick为空..")
|
// console.log("tick为空..")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,13 @@
|
||||||
<script src="public/login/js/jquery-3.7.1.min.js"></script>
|
<script src="public/login/js/jquery-3.7.1.min.js"></script>
|
||||||
<script type="text/javascript" src="public/login/js/layui.js"></script>
|
<script type="text/javascript" src="public/login/js/layui.js"></script>
|
||||||
<script src="public/login/js/aes.js"></script>
|
<script src="public/login/js/aes.js"></script>
|
||||||
<script src="public/login/public.js"></script>
|
<script src="public/public.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
getVerifyCode();
|
getVerifyCode();
|
||||||
|
|
||||||
//获取验证码
|
//获取验证码
|
||||||
function getVerifyCode() {
|
function getVerifyCode() {
|
||||||
var url = IP_ADDRESS+"/code?" + Math.random();
|
var url = request_url+"/code?" + Math.random();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
//请求方式
|
//请求方式
|
||||||
type : "GET",
|
type : "GET",
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
} else {
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : 'post',
|
type : 'post',
|
||||||
url : IP_ADDRESS + '/realname/allSystem/login',
|
url : request_url + '/realname/allSystem/login',
|
||||||
contentType:'application/json;charset=UTF-8',
|
contentType:'application/json;charset=UTF-8',
|
||||||
data :JSON.stringify( {
|
data :JSON.stringify( {
|
||||||
username:encryptCBC(username),
|
username:encryptCBC(username),
|
||||||
|
|
@ -106,6 +106,7 @@
|
||||||
if(data.code=='200'){
|
if(data.code=='200'){
|
||||||
localStorage.setItem("public_token",data.data.access_token);
|
localStorage.setItem("public_token",data.data.access_token);
|
||||||
localStorage.setItem("auth_type",data.data.user.dataType)
|
localStorage.setItem("auth_type",data.data.user.dataType)
|
||||||
|
localStorage.setItem("public_username",username);
|
||||||
//登录成功
|
//登录成功
|
||||||
window.location.href="home.html";
|
window.location.href="home.html";
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('1')">
|
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('1')">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-gray-500 text-sm">实名制</p>
|
<p class="text-gray-500 text-sm">实名制后台管理子系统</p>
|
||||||
<h3 class="text-2xl font-bold mt-2">12,458</h3>
|
<h3 class="text-2xl font-bold mt-2">12,458</h3>
|
||||||
<p class="text-green-500 text-sm mt-2 flex items-center">
|
<p class="text-green-500 text-sm mt-2 flex items-center">
|
||||||
<i class="fa fa-arrow-up mr-1"></i> 12.5%
|
<i class="fa fa-arrow-up mr-1"></i> 12.5%
|
||||||
|
|
@ -46,8 +46,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 总用户数 -->
|
||||||
|
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('2')">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-gray-500 text-sm">实名制后台大屏子系统</p>
|
||||||
|
<h3 class="text-2xl font-bold mt-2">12,458</h3>
|
||||||
|
<p class="text-green-500 text-sm mt-2 flex items-center">
|
||||||
|
<i class="fa fa-arrow-up mr-1"></i> 12.5%
|
||||||
|
<span class="text-gray-500 ml-1">较上月</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="h-12 w-12 rounded-full bg-blue-100 flex items-center justify-center text-primary">
|
||||||
|
<i class="fa fa-users text-xl"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 新增用户 -->
|
<!-- 新增用户 -->
|
||||||
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('2')">
|
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('3')">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-gray-500 text-sm">领导履职</p>
|
<p class="text-gray-500 text-sm">领导履职</p>
|
||||||
|
|
@ -64,10 +81,26 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 活跃用户 -->
|
<!-- 活跃用户 -->
|
||||||
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('3')">
|
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('4')">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-gray-500 text-sm">承载力</p>
|
<p class="text-gray-500 text-sm">承载力后台管理子系统</p>
|
||||||
|
<h3 class="text-2xl font-bold mt-2">2,521</h3>
|
||||||
|
<p class="text-green-500 text-sm mt-2 flex items-center">
|
||||||
|
<i class="fa fa-arrow-up mr-1"></i> 5.3%
|
||||||
|
<span class="text-gray-500 ml-1">较昨日</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="h-12 w-12 rounded-full bg-purple-100 flex items-center justify-center text-purple-600">
|
||||||
|
<i class="fa fa-eye text-xl"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 活跃用户 -->
|
||||||
|
<div class="bg-white rounded-xl shadow-sm p-6 card-hover" onclick="openSystem('5')">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-gray-500 text-sm">承载力大屏子系统</p>
|
||||||
<h3 class="text-2xl font-bold mt-2">2,521</h3>
|
<h3 class="text-2xl font-bold mt-2">2,521</h3>
|
||||||
<p class="text-green-500 text-sm mt-2 flex items-center">
|
<p class="text-green-500 text-sm mt-2 flex items-center">
|
||||||
<i class="fa fa-arrow-up mr-1"></i> 5.3%
|
<i class="fa fa-arrow-up mr-1"></i> 5.3%
|
||||||
|
|
@ -79,12 +112,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<script src="../public.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function openSystem(id) {
|
function openSystem(id) {
|
||||||
alert("当前打开的系统为:"+ id);
|
let username=localStorage.getItem("public_username");
|
||||||
|
let token=localStorage.getItem("public_token");
|
||||||
|
let url=web_url+contentPath;
|
||||||
|
if(id==='1'){
|
||||||
|
window.open(url+'/smz-web/lodingIndex.html?token='+username,'smz_html');
|
||||||
|
}else if(id==='2'){
|
||||||
|
window.open(url+'/smz-screen/lodingIndex.html?token='+username,'smz_web_html');
|
||||||
|
}else if(id==='3'){
|
||||||
|
window.open('http://127.0.0.1:80/ldlz/ywgllogin?username='+username+"&token="+token,'ldlz_html');
|
||||||
|
}else if(id==='4'){
|
||||||
|
window.open(url+'/czl-web/lodingIndex.html?token='+username,'czl_html');
|
||||||
|
}else if(id==='5'){
|
||||||
|
window.open(url+'/czl-screen/lodingIndex.html?token='+username,'czl_web_html');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
<html lang="en" >
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
let IP_ADDRESS='http://192.168.0.38:42880';
|
|
||||||
let contentPath="/hn_cloud_web/";
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
let request_url="http://192.168.0.38:42880/"
|
let web_url="http://127.0.0.1:8848"
|
||||||
|
let contentPath="/hn_cloud_web";
|
||||||
|
let request_url="http://192.168.0.38:42880"
|
||||||
let public_token=localStorage.getItem("public_token")
|
let public_token=localStorage.getItem("public_token")
|
||||||
|
|
@ -216,15 +216,16 @@
|
||||||
const urlParam = new URLSearchParams(url.search);
|
const urlParam = new URLSearchParams(url.search);
|
||||||
const path = url.pathname; // 输出: "/page"
|
const path = url.pathname; // 输出: "/page"
|
||||||
const token = urlParam.get('token'); // 输出: "value1"
|
const token = urlParam.get('token'); // 输出: "value1"
|
||||||
if(token){
|
let username=localStorage.getItem("public_username");
|
||||||
|
if(username){
|
||||||
const params = {
|
const params = {
|
||||||
"username": token,
|
"username": encryptCBC(username),
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers:{
|
headers:{
|
||||||
"Authorization":public_token
|
"Authorization":public_token
|
||||||
},
|
},
|
||||||
url: request_url + 'realnameweb/publicLogin/defaultLogin',
|
url: request_url + '/realnameweb/publicLogin/defaultLogin',
|
||||||
data: JSON.stringify(params),
|
data: JSON.stringify(params),
|
||||||
async : true,
|
async : true,
|
||||||
method:"POST",
|
method:"POST",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
var ctxPath = "http://192.168.0.50:42880/realname"
|
var ctxPath = "http://192.168.0.38:42880/realname"
|
||||||
//湖南
|
//湖南
|
||||||
let contentPath="/hn_cloud_web/smz-web"
|
let contentPath="/hn_cloud_web/smz-web"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -216,21 +216,21 @@
|
||||||
const urlParam = new URLSearchParams(url.search);
|
const urlParam = new URLSearchParams(url.search);
|
||||||
const path = url.pathname; // 输出: "/page"
|
const path = url.pathname; // 输出: "/page"
|
||||||
const token = urlParam.get('token'); // 输出: "value1"
|
const token = urlParam.get('token'); // 输出: "value1"
|
||||||
if(token){
|
let username=localStorage.getItem("public_username");
|
||||||
|
if(username){
|
||||||
const params = {
|
const params = {
|
||||||
"username": token,
|
"username": encryptCBC(username),
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers:{
|
headers:{
|
||||||
"Authorization":public_token
|
"Authorization":public_token
|
||||||
},
|
},
|
||||||
url: request_url + 'realname/publicLogin/defaultLogin',
|
url: request_url + '/realname/publicLogin/defaultLogin',
|
||||||
data: JSON.stringify(params),
|
data: JSON.stringify(params),
|
||||||
async : true,
|
async : true,
|
||||||
method:"POST",
|
method:"POST",
|
||||||
contentType:'application/json;charset=UTF-8',
|
contentType:'application/json;charset=UTF-8',
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
debugger
|
|
||||||
if(data.code && data.code!='200'){
|
if(data.code && data.code!='200'){
|
||||||
window.location.href="../login.html";
|
window.location.href="../login.html";
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -255,7 +255,7 @@
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// alert("请先登录");
|
// alert("请先登录");
|
||||||
// window.location.href="../login.html";
|
window.location.href="../login.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue