role1.0
fanluyan 1 year ago
parent 2f54c610a0
commit 221be28fff

@ -63,7 +63,6 @@ export default {
index: "/realTimeMonitor",
title: "实时监控",
},
{
icon: "el-icon-film",
index: "/pictureRotation",
@ -74,7 +73,6 @@ export default {
index: "/photoAlarm",
title: "告警处理",
},
{
icon: "el-icon-search",
index: "/realTimeSearch",
@ -289,6 +287,7 @@ export default {
},
],
role: "",
menuList: [],
};
},
@ -309,25 +308,23 @@ export default {
this.role = localStorage.getItem("role");
console.log("用户管理");
console.log(this.role);
// if (this.role == 0) {
// this.items = this.items;
// } else {
// this.items = this.items1;
// this.menuList = JSON.parse(localStorage.getItem("menuPermission"));
// this.items = this.menuList;
// }
if (this.role == 0) {
console.log("ssssssssssssssssssssssssssssssssssssssss");
this.items = this.items;
} else if (this.role == 1) {
this.items = this.items1;
} else if (this.role == 2) {
this.items = this.items2;
} else if (this.role == 4) {
console.log("ssssssssssssssssssssssssssssssssssssssss");
this.items = this.hnjcitems;
console.log("ssssssssssssssssssssssssssssssssssssssss", this.items);
}
this.activeIndex = this.items[0].index;
console.log(this.items);
console.log(this.activeIndex);
},

@ -6,9 +6,19 @@
:close-on-click-modal="false"
width="420px"
>
<el-form :model="psdForm" :rules="rules" ref="formInfo" label-position="left" label-width="80px">
<el-form
:model="psdForm"
:rules="rules"
ref="formInfo"
label-position="left"
label-width="80px"
>
<el-form-item label="用户名:">
<el-input v-model="psdForm.userName" autocomplete="off" :disabled="true"></el-input>
<el-input
v-model="psdForm.userName"
autocomplete="off"
:disabled="true"
></el-input>
</el-form-item>
<!-- <el-form-item label="原密码:">
<el-input v-model="psdForm.originalPsd" autocomplete="off"></el-input>
@ -31,9 +41,9 @@ import { updateUserApi } from "@/utils/api/index";
export default {
data() {
return {
isShow:false,
isShow: false,
psdForm: {
userName: localStorage.getItem('userName'),
userName: localStorage.getItem("userName"),
originalPsd: "",
newPsd: "",
password: "",
@ -54,12 +64,12 @@ export default {
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
this.$set(this.psdForm,'userId',localStorage.getItem('userid'))
this.$set(this.psdForm, "uid", localStorage.getItem("uid"));
updateUserApi(this.psdForm)
.then((res) => {
if (res.code == 200) {
this.$message.success("修改成功,请重新登录");
this.isShow = false
this.isShow = false;
this.$store.commit("REMOVE_INFO");
this.$router.push("/login");
} else {

@ -8,7 +8,7 @@ export default new Vuex.Store({
//用户登录token 存储
token: "",
userName: "",
userid: "",
uid: "",
role: "",
currentData: "",
channelId: "",
@ -22,6 +22,7 @@ export default new Vuex.Store({
token: (state) => state.token,
userName: (state) => state.userName,
role: (state) => state.role,
menuPermission: (state) => state.resources,
},
mutations: {
//点击获取的左侧列表
@ -64,11 +65,13 @@ export default new Vuex.Store({
},
SET_USERINFO(state, val) {
state.userName = val.userName;
state.userid = val.id;
state.uid = val.uid;
state.role = val.role;
state.resources = val.resources;
localStorage.setItem("userName", state.userName);
localStorage.setItem("userid", state.userid);
localStorage.setItem("uid", state.uid);
localStorage.setItem("role", state.role);
localStorage.setItem("menuPermission", JSON.stringify(state.resources));
},
//退出清除locastorge
REMOVE_INFO(state) {

@ -872,7 +872,7 @@ export function listApk(data) {
}
//上传apk
export function uploadApk(data) {
export function uploadApk(data, onUploadProgress) {
return request({
url: "/xymanager/uploadApk",
method: "post",
@ -880,6 +880,7 @@ export function uploadApk(data) {
headers: {
"Content-Type": "multipart/form-data", // set the content type to multipart/form-data
},
onUploadProgress: onUploadProgress, // 允许外部传递进度回调函数
});
}

@ -13,7 +13,7 @@ const service = axios.create({
service.interceptors.request.use((config) => {
if (localStorage.getItem("token")) {
console.log("aaaaaaaaaaaaaa", localStorage.getItem("token"));
// console.log("aaaaaaaaaaaaaa", localStorage.getItem("token"));
config.headers.Authorization = localStorage.getItem("token");
}
return config;

@ -81,12 +81,7 @@ export default {
this.$store.commit("SET_TOKEN", res.data.token); //tokenvuex
this.$store.commit("SET_USERINFO", res.data); //vuex
console.log(res.data);
if (res.data.role == 5) {
this.$router.push("/weather");
} else {
this.$router.push("/stritl");
}
this.$router.push("/stritl");
this.$message({
duration: 1500,
showClose: true,

@ -1927,6 +1927,7 @@ export default {
//
handleupgradation() {
console.log(this.upgradationform.upVal);
console.log(this.selectUpObj.name);
this.$refs.upgradationRuleForm.validate((valid) => {
if (valid) {
this.ugradLoading = true;
@ -1939,6 +1940,10 @@ export default {
name: "file",
value: this.upgradationform.upVal,
},
{
name: "name",
value: this.selectUpObj.name,
},
];
this.setTermFn(params);
}

@ -7,6 +7,7 @@
class="upload-demo"
ref="upload"
action="#"
:before-upload="beforeUpload"
:http-request="customUpload"
:limit="1"
:file-list="fileList"
@ -190,6 +191,14 @@ export default {
//
console.log(this.progress); // 使使
},
beforeUpload(file) {
const fileName = file.name;
if (fileName.length > 19) {
this.$message.error("文件名长度不能超过 19 个字符!");
return false; //
}
return true; //
},
// //
// beforeAvatarUpload(file) {
// console.log(this.reportData.title);
@ -206,7 +215,19 @@ export default {
formData.append("file", options.file);
formData.append("title", this.reportData.title); //
console.log(formData);
uploadApk(formData)
uploadApk(formData, (progressEvent) => {
//
const percentCompleted = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);
this.progressLoading = true;
// UI
console.log(`上传进度: ${percentCompleted}%`);
this.progress = Math.round(percentCompleted);
// Vue
// this.uploadProgress = percentCompleted; // data
})
.then((res) => {
console.log(res);
// this.progressLoading = true;
@ -220,7 +241,7 @@ export default {
this.reportData.title = "";
this.$refs.upload.clearFiles();
this.getUpgradeList();
// this.progressLoading = false;
this.progressLoading = false;
} else {
this.$message({
duration: 1500,

@ -26,12 +26,12 @@
prop="id"
></el-table-column>
<el-table-column
label="key"
label="路由名称"
show-overflow-tooltip
prop="key"
></el-table-column>
<el-table-column
label="desc"
label="菜单名称"
show-overflow-tooltip
prop="desc"
></el-table-column>

@ -21,6 +21,13 @@
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="备注:" prop="desc">
<el-input
placeholder="请输入备注"
v-model="formdata.desc"
autocomplete="off"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
@ -41,10 +48,10 @@ export default {
formdata: {},
rules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
name: [{ required: true, message: "请输入角色名", trigger: "blur" }],
},
xgrules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
name: [{ required: true, message: "请输入角色名", trigger: "blur" }],
},
};
},

@ -30,7 +30,11 @@
show-overflow-tooltip
prop="name"
></el-table-column>
<el-table-column
label="备注"
show-overflow-tooltip
prop="desc"
></el-table-column>
<el-table-column
label="创建时间"
show-overflow-tooltip
@ -106,7 +110,7 @@ export default {
this.roleListAll();
},
methods: {
//线
//
roleListAll() {
getRoleList()
.then((res) => {

@ -105,14 +105,23 @@ export default {
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
getRoleListAll() {
getRoleList()
.then((res) => {
//
console.log("获取角色列表", res.data);
this.roleoptions = res.data.filter((role) => role.id !== 0);
})
.catch((err) => {});
},
// getRoleListAll() {
// getRoleList()
// .then((res) => {
// //
// this.roleoptions = res.data.filter((role) => role.id !== 0);
// })
// .catch((err) => {});
// },
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
@ -154,7 +163,7 @@ export default {
display() {
this.isShow = true;
this.roleUser = localStorage.getItem("role");
//this.getRoleListAll();
this.getRoleListAll();
},
hide() {
this.isShow = false;

@ -31,13 +31,13 @@
<!-- <el-table-column label="角色" show-overflow-tooltip prop="roleName">
<template slot-scope="scope">{{ scope.row.roleName }}</template>
</el-table-column> -->
<el-table-column label="角色" show-overflow-tooltip prop="role">
<template slot-scope="scope">
<el-table-column label="角色" show-overflow-tooltip prop="roleName">
<!-- <template slot-scope="scope">
<span v-if="scope.row.role == 0"></span>
<span v-else-if="scope.row.role == 1">管理员</span>
<span v-else-if="scope.row.role == 2">用户</span>
<span v-else>{{ scope.row.role }}</span>
</template>
</template> -->
</el-table-column>
<el-table-column
label="备注"
@ -129,6 +129,7 @@ export default {
})
.catch((err) => {});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);

@ -23,7 +23,7 @@ module.exports = defineConfig({
//表示拦截以/api开头的请求路径
//target: "http://47.96.238.157:8093", //阿里云服务器环境
target: "http://180.166.218.222:40080", //dell
//target: "http://192.168.1.190:8080", //liu 本机ip
//target: "http://192.168.1.190:8080", //liu 本机ip 需要去掉/Api
// target: "http://192.168.50.42:81", //东视
changOrigin: true, //是否开启跨域
pathRewrite: {

Loading…
Cancel
Save