增加加密
This commit is contained in:
parent
5cd462507a
commit
5bb151c352
186
nginx.conf
186
nginx.conf
|
|
@ -1,186 +0,0 @@
|
|||
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
server_tokens off;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
#access_log logs/access.log main;
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
#keepalive_timeout 0;
|
||||
keepalive_timeout 65;
|
||||
client_max_body_size 100M;
|
||||
client_body_buffer_size 100M;
|
||||
fastcgi_buffer_size 128k;
|
||||
fastcgi_buffers 8 128k;
|
||||
fastcgi_busy_buffers_size 128k;
|
||||
fastcgi_temp_file_write_size 128k;
|
||||
#gzip on;
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
charset utf-8;
|
||||
|
||||
|
||||
location /nxdt {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/nxdt;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /nxdt/index.html;
|
||||
}
|
||||
location /option {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/option;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /option/index.html;
|
||||
}
|
||||
location /search-tool {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/search-tool;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /search-tool/index.html;
|
||||
}
|
||||
|
||||
location /zhgd-ht {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/zhgd-ht;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /zhgd-ht/index.html;
|
||||
}
|
||||
location /zhgd-web {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/zhgd-web;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /zhgd-web/sg_login.html;
|
||||
}
|
||||
|
||||
location /smartSiteScreen {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/smartSiteScreen;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /smartSiteScreen/index.html;
|
||||
}
|
||||
location /output {
|
||||
# 网站根目录,此处使用容器内的路径
|
||||
alias /usr/local/www/output;
|
||||
# 默认首页
|
||||
index index.html;
|
||||
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
try_files $uri $uri/ /output/index.html;
|
||||
}
|
||||
#location / {
|
||||
# # 网站根目录,此处使用容器内的路径
|
||||
# root /usr/local/www/;
|
||||
# # 默认首页
|
||||
# index index.html;
|
||||
# # 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
|
||||
# try_files $uri $uri/ /index.html;
|
||||
# }
|
||||
|
||||
location /file/ {
|
||||
rewrite ^/file/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:19300/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /dev-api/ {
|
||||
rewrite ^/dev-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:28080/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /nxdt-api/ {
|
||||
rewrite ^/dev-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:18080/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /zhgd/ {
|
||||
rewrite ^/dev-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:13030/zhgd/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /prod-api/ {
|
||||
rewrite ^/dev-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:18080/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /option-api/ {
|
||||
rewrite ^/option-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:21666/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /screen/ {
|
||||
#rewrite ^.+api/?(.*)$ /$1 break; #这样写有问题,在网上看有人这样写,发现有问题
|
||||
rewrite ^/screen/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:28080/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
location /search-tool-api/ {
|
||||
#rewrite ^.+api/?(.*)$ /$1 break; #这样写有问题,在网上看有人这样写,发现有问题
|
||||
rewrite ^/screen/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api
|
||||
proxy_pass http://192.168.0.14:58089/; #跨域转发路由地址
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
#location ~* \.pdf$ {
|
||||
# add_header Content-Type application/pdf;
|
||||
#}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,20 +1,39 @@
|
|||
<template>
|
||||
<div class="login">
|
||||
<div class="login-main" :element-loading-text="loadingMsg" v-loading="loading">
|
||||
<div
|
||||
class="login-main"
|
||||
:element-loading-text="loadingMsg"
|
||||
v-loading="loading"
|
||||
>
|
||||
<!-- <h3 class="login-title">登录</h3> -->
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
status-icon
|
||||
>
|
||||
<el-form-item prop="userName">
|
||||
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
|
||||
<el-input
|
||||
v-model="dataForm.password"
|
||||
type="password"
|
||||
placeholder="密码"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item prop="verCode">
|
||||
<el-input style="width:60%!important;float:left" v-model="dataForm.verCode" placeholder="验证码"></el-input>
|
||||
<img @click="getVerCode()" :src="codeImg" width="100" height="40" class="head_pic" style="float:right" />
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button class="login-btn-submit" type="primary" @click="dataFormSubmit()">登录</el-button>
|
||||
<el-button
|
||||
class="login-btn-submit"
|
||||
type="primary"
|
||||
@click="dataFormSubmit()"
|
||||
>登录</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -23,47 +42,43 @@
|
|||
|
||||
<script>
|
||||
import AES from "@/plugins/cryptoJs/aes";
|
||||
import { userLogin } from "@/api/account"
|
||||
import Mqtt from '../../components/mqtt.vue'
|
||||
import { userLogin } from "@/api/account";
|
||||
import Mqtt from "../../components/mqtt.vue";
|
||||
export default {
|
||||
name: 'login',
|
||||
name: "login",
|
||||
components: {
|
||||
Mqtt
|
||||
Mqtt,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
userName: '',
|
||||
password: '',
|
||||
uuid: '',
|
||||
captcha: '',
|
||||
verCode:"",
|
||||
codeId:""
|
||||
userName: "",
|
||||
password: "",
|
||||
uuid: "",
|
||||
captcha: "",
|
||||
verCode: "",
|
||||
codeId: "",
|
||||
},
|
||||
dataRule: {
|
||||
userName: [
|
||||
{ required: true, message: '帐号不能为空', trigger: 'blur' }
|
||||
{ required: true, message: "帐号不能为空", trigger: "blur" },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '密码不能为空', trigger: 'blur' }
|
||||
{ required: true, message: "密码不能为空", trigger: "blur" },
|
||||
],
|
||||
// verCode: [
|
||||
// { required: true, message: '验证码不能为空', trigger: 'blur' }
|
||||
// ]
|
||||
},
|
||||
captchaPath: '',
|
||||
captchaPath: "",
|
||||
loading: false, //初始化loading
|
||||
loadingMsg: "",
|
||||
codeImg:"",
|
||||
codeId:""
|
||||
|
||||
|
||||
codeImg: "",
|
||||
codeId: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
mounted() {},
|
||||
methods: {
|
||||
createLoad() {
|
||||
this.loading = true;
|
||||
this.loadingMsg = "登录中...";
|
||||
|
|
@ -73,32 +88,33 @@ export default {
|
|||
this.loadingMsg = "";
|
||||
},
|
||||
// 提交表单
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
sessionStorage.removeItem("token")
|
||||
sessionStorage.removeItem("token");
|
||||
this.createLoad();
|
||||
var userPossword = AES.encrypt(this.dataForm.password)
|
||||
var username = AES.encrypt(this.dataForm.userName)
|
||||
var userPossword = AES.encrypt(this.dataForm.password);
|
||||
var username = AES.encrypt(this.dataForm.userName);
|
||||
// let param = new URLSearchParams()
|
||||
// param.append('userName', this.dataForm.password)
|
||||
// param.append('password', this.dataForm.password)
|
||||
let Content = {
|
||||
'username': this.dataForm.userName,
|
||||
'password': this.dataForm.password,
|
||||
// 'password': userPossword,
|
||||
// 'username': this.dataForm.userName,
|
||||
username,
|
||||
// 'password': this.dataForm.password,
|
||||
password: userPossword,
|
||||
// 'verCode' :this.dataForm.verCode,
|
||||
// 'codeId' :this.dataForm.codeId
|
||||
|
||||
};
|
||||
|
||||
// console.log(Content)
|
||||
userLogin(Content).then(res => {
|
||||
userLogin(Content)
|
||||
.then((res) => {
|
||||
if (res.code == "200") {
|
||||
console.log("success")
|
||||
console.log("success");
|
||||
this.clearLoad();
|
||||
sessionStorage.setItem('token',res.token)
|
||||
this.$router.replace({ name: 'fullScreen' })
|
||||
sessionStorage.setItem("token", res.token);
|
||||
this.$router.replace({ name: "fullScreen" });
|
||||
|
||||
// setToken(res.returnData.token);
|
||||
// this.$router.replace({ name: 'home' })
|
||||
|
|
@ -106,29 +122,27 @@ export default {
|
|||
// this.getVerCode();
|
||||
this.$message({
|
||||
message: res.message,
|
||||
type: "warning"
|
||||
type: "warning",
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.clearLoad();
|
||||
}, 300);
|
||||
}
|
||||
}).catch(err => {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
setTimeout(() => {
|
||||
this.clearLoad();
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.login{
|
||||
.login {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
|
@ -143,7 +157,7 @@ export default {
|
|||
margin-left: 35%;
|
||||
position: absolute;
|
||||
top: 20%;
|
||||
left: 30% ;
|
||||
left: 30%;
|
||||
padding: 1.875rem 0.75rem 2.25rem;
|
||||
width: 18%;
|
||||
min-height: 15%;
|
||||
|
|
@ -166,8 +180,5 @@ export default {
|
|||
.el-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue