代码提交

This commit is contained in:
lixiaobang 2023-03-21 13:58:18 +08:00
parent adfd80734c
commit bc1fb48da3
14 changed files with 16243 additions and 646 deletions

View File

@ -20,7 +20,7 @@ module.exports = {
// },
'/api': {
// target: 'http://10.6.0.26:81',
target: 'http://175.27.191.156:11000/',
target: 'http://175.27.191.156:11000/api/',
changeOrigin: true,
pathRewrite: {
'^/api': ''

17
jsconfig.json Normal file
View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
}
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist"
]
}

16693
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
"js-cookie": "^3.0.1",
"jspdf": "^2.5.1",
"mqtt": "^3.0.0",
"node-sass": "^8.0.0",
"postcss-plugin-px2rem": "^0.8.1",
"screenfull": "5.2.0",
"v-scale-screen": "^1.0.0",
@ -53,7 +54,6 @@
"less-loader": "^4.1.0",
"lockr": "^0.8.5",
"node-notifier": "^5.1.2",
"node-sass": "^4.7.2",
"nprogress": "0.2.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",

View File

@ -7,10 +7,15 @@ if (process.env.NODE_ENV === 'development') {
axios.defaults.baseURL = '/'
}
//获取token
export const getToken = (params) => {
return axios.get('api/blade-auth/oauth/token', {
params
})
export const getToken = (data) => {
// axios.defaults.headers.common['Authorization'] = `Basic c2FiZXI6c2FiZXJfc2VjcmV0`;
// axios.defaults.headers.common['Tenant-Id'] = `748495`
return axios.post('api/blade-auth/oauth/token'+'?grant_type='+data.grant_type+'&scope='+data.scope
+'&tenantId='+data.tenantId+'&username='+data.username+'&password='+data.password+'&type='+data.type,
data,
{headers: {'Authorization':'Basic c2FiZXI6c2FiZXJfc2VjcmV0',
'Tenant-Id': '748495','Content-Type': 'application/json;charset=UTF-8'}}
)
};
export function filterCompanyAPI (params) {
return request({

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -606,6 +606,7 @@ export default {
top: 50%;
transform: translateY(-50%);
right: 0;
z-index: 999;
}
.box {

View File

@ -336,7 +336,9 @@ export default {
this.vdaH = h - 0 + "px";
this.createMqtt()
this.getWeather()
window.setInterval(()=>{
this.getTime()
},1000)
},
methods: {
createMqtt() {
@ -393,6 +395,7 @@ export default {
url: 'https://restapi.amap.com/v3/weather/weatherInfo?key=e979d73682c0c69059e4cb6740c9dacd&city=320100',
methods: ''
}).then(res => {
console.log(res.data,'=======================');
this.weatherItem = res.data.lives[0];
});
} ,
@ -498,6 +501,7 @@ export default {
}
},
switchDiv() {
let that = this
if (this.type) {
this.type = false;
this.$refs.switchBtn.style.display = "none";
@ -505,7 +509,7 @@ export default {
this.type = true;
setTimeout(() => {
//
this.$refs.switchBtn.style.display = "block";
that.$refs.switchBtn.style.display = "block";
}, 800)
}
}
@ -1256,6 +1260,7 @@ position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0px;
z-index: 999;
}
.box {

View File

@ -20,12 +20,17 @@
<div class="content">
<div class="welcome">欢迎登录</div>
<el-form :model="param" :rules="rules" ref="login" label-width="100px" label-position="top" class="ms-content">
<el-form-item prop="username" label="用户名">
<el-input v-model="param.username" placeholder="输入您的账号">
<el-form-item prop="tenantId" label="" style="margin-bottom:35px">
<el-input v-model="param.tenantId" placeholder="请输入您的租户id">
<el-button slot="prepend" icon="el-icon-user"></el-button>
</el-input>
</el-form-item>
<el-form-item prop="password" label="密码" style="margin-top: 15px">
<el-form-item prop="username" label="" style="margin-bottom:35px">
<el-input v-model="param.username" placeholder="请输入您的账号">
<el-button slot="prepend" icon="el-icon-user"></el-button>
</el-input>
</el-form-item>
<el-form-item prop="password" label="" style="margin-top: 15px;margin-bottom:35px">
<el-input type="password" placeholder="请输入密码" v-model="param.password" @keyup.enter.native="submitForm()">
<el-button slot="prepend" icon="el-icon-lock"></el-button>
</el-input>
@ -48,7 +53,7 @@ import BarChart from "@/components/common/BarChart";
import mdScreenPie from "@/components/common/mdScreenPie";
import Swiper from "@/components/common/carousel";
import Resize from '../utils/Resize.vue'
import {getToken} from "../api/api";
import {getToken} from "@/api/api";
export default {
name: "report",
components: {
@ -63,11 +68,13 @@ export default {
showType: true,
topicSends:[],
param: {
username: '',
password: ''
username: 'dlgc_pic',
password: 'e19d5cd5af0378da05f63f891c7467af',
tenantId:'748495'
},
checked: false,
rules: {
tenantId: [{ required: true, message: '账号Id不能为空', trigger: 'blur' }],
username: [{ required: true, message: '账号不能为空', trigger: 'blur' }],
password: [{ required: true, message: '密码不能为空', trigger: 'blur' }]
}
@ -78,38 +85,46 @@ export default {
this.vdaH = h - 0 + "px";
this.createMqtt()
this.getWeather()
this.getTokenData()
// this.getTokenData()
},
methods: {
getTokenData(){
// getToken({grant_type:'password',scope:'all',tenantId:'748495',username:'dlgc_pic',password:'e19d5cd5af0378da05f63f891c7467af',type:"account"}).then(res => {
// console.log("res",res.data)
// })
var data = {
let data = {
grant_type:'password',
scope:'all',
tenantId:'748495',
username:'dlgc_pic',
password:'e19d5cd5af0378da05f63f891c7467af',
type:"account"}
axios({
method: "get",
url: `${baseUrl}file/local/files`,
data: data,
headers: {
Authorization: "Bearer " + token,
},
getToken(data).then((res)=>{
})
.then(function(res) {
console.log(e.file.name);
z.modelshowdata.fileList = [
{ fileName: e.file.name, filePath: v.data.fileName },
];
z.$message.success("上传成功");
})
.catch(function(err) {
z.$message.error("请求失败");
});
// this.$axios({
// method: "post",
// // url: `${baseUrl}file/local/files`,
// url: `http://175.27.191.156:11000/api/blade-auth/oauth/token`,
// data: data,
// dataType: 'jsonp',
// headers: {
// // Authorization: "Basic " + token,
// Authorization: 'Basic c2FiZXI6c2FiZXJfc2VjcmV0',
// TenantId: '748495'
// },
// })
// .then(function(res) {
// console.log(res.data,'================');
// // z.modelshowdata.fileList = [
// // { fileName: e.file.name, filePath: v.data.fileName },
// // ];
// // z.$message.success("");
// })
// .catch(function(err) {
// // z.$message.error("");
// });
},
@ -132,9 +147,32 @@ export default {
// }).then(res => {
// console.log('c', res);
// if(res.data.code==200){
let data = {
grant_type:'password',
scope:'all',
tenantId:this.param.tenantId,
username:this.param.username,
password:this.param.password,
type:"account"
}
getToken(data).then((res)=>{
if (res.status == 200) {
this.$message.success('登录成功');
localStorage.setItem('ms_username', this.param.username);
// localStorage.setItem('ms_username', this.param.username);
this.$router.push('/index');
sessionStorage.setItem(
"token",
JSON.stringify(res.data.access_token)
);
sessionStorage.setItem(
"ms_username",
JSON.stringify(res.data.user_name)
);
}else{
this.$message.error('请输入正确的登录信息!!!');
}
})
// }else{
// this.$message({
// message: res.data.msg,
@ -143,7 +181,7 @@ export default {
// }
// });
} else {
this.$message.error('请输入账号和密码');
this.$message.error('请输入账号和密码');
console.log('error submit!!');
return false;
}
@ -241,7 +279,7 @@ getWeather () {
.bgPicture {
width: 100%;
background: url("~@/assets/pic/BG.jpg") no-repeat;
background: url('../assets/loginImg/loginBg.png') no-repeat;
background-size: 100% 100%;
}
@ -548,7 +586,8 @@ getWeather () {
width: 100%;
height: 100%;
border-radius: 20px;
border: 1px solid rgb(231, 231, 231);
background: rgb(9,41,43);
border: none;
.el-input-group__prepend {
background: transparent;
border: none;
@ -558,6 +597,13 @@ getWeather () {
border: none;
}
}
/deep/ .el-checkbox{
color: #fff;
}
/deep/ .el-checkbox__inner{
background: transparent;
border: 1px solid rgb(0,139,146)
}
.login-wrap {
position: absolute;
width: 100%;
@ -566,11 +612,11 @@ getWeather () {
background: url('~@/assets/img/newlogin-bg.png');
}
.ms-login {
width: 24%;
height: 59%;
width: 31%;
height: 51%;
position: absolute;
left: 58.44%;
top: 23.2%;
left: 35.44%;
top: 22.2%;
.ms-title {
width: 100%;
height: 42px;
@ -582,32 +628,42 @@ getWeather () {
width: 100%;
height: calc(100% - 75px);
border-radius: 20px;
background: #ffffff;
background: url('../assets/loginImg/kuang.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
display: flex;
flex-flow: column nowrap;
align-items: center;
.welcome {
margin-top: 28px;
font-size: 16px;
font-size: 20px;
letter-spacing: 1px;
// color: black;
color: #fff;
font-weight: 700
}
.ms-content {
width: 80%;
margin-top: 25px;
margin-top: 33px;
}
.login-btn {
width: 80%;
width: 75.5%;
height: 63px;
margin-top: 45px;
/deep/ .el-button {
width: 100%;
border-radius: 20px;
height: 100%;
// border-radius: 20px;
display: flex;
justify-content: center;
background: url("../assets/loginImg/loginBtn.png") no-repeat;
background-size: 100% 100%;
border: none;
align-items: center;
span {
letter-spacing: 15px;
margin-left: 15px;
font-size: 18px;
font-weight: 600;
}
}
}

View File

@ -884,6 +884,9 @@ export default {
position: absolute;
left: 50%;
transform: translateX(-50%);
::-webkit-scrollbar {
display: none;
}
}
.securityCheck {

View File

@ -542,6 +542,7 @@ export default {
}
},
switchDiv() {
let that = this
if (this.type) {
this.type = false;
this.$refs.switchBtn.style.display = "none";
@ -549,14 +550,15 @@ export default {
this.type = true;
setTimeout(() => {
//
this.$refs.switchBtn.style.display = "block";
that.$refs.switchBtn.style.display = "block";
}, 800)
}
}
},
mounted() {
this.switchDiv(); window.onresize = () => {
// this.switchDiv();
window.onresize = () => {
return (() => {
let h = document.documentElement.clientHeight || document.body.clientHeight;
this.vdaH = h - 0 + "px";
@ -888,6 +890,9 @@ export default {
position: absolute;
left: 50%;
transform: translateX(-50%);
::-webkit-scrollbar {
display: none;
}
}
.securityCheck {

View File

@ -1,5 +1,5 @@
body { padding: 0; margin: 0 }
#unity-container { position: absolute }
#unity-container { position: absolute;width: 1920px;height: 1080px; }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { width: 100%; height: 100% }
#unity-canvas { background: #231F20 }