7 files modified
1 files added
| | |
| | | }) |
| | | } |
| | | |
| | | export const getUserInfos = () => { |
| | | return request({ |
| | | url: '/api/blade-user/getUserInfo', |
| | | method: 'get', |
| | | params: { |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getUserPlatform = (id) => { |
| | | return request({ |
| | | url: '/api/blade-user/platform-detail', |
| New file |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/list', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getPage = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getAll = () => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/all', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | export const getDetails = (id) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/details', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getDetail = (id) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/detail', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/save', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/villageInfo/villageInfo/update', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | |
| | | import tenantPackage from './views/system/tenantpackage'; |
| | | |
| | | |
| | | import Cookies from 'js-cookie' |
| | | // 携带token跳转页面设置 |
| | | |
| | | const tokenLength = window.location.href.indexOf('='); |
| | | if(tokenLength>0){ |
| | | //取“=”之后的token |
| | | let z = window.location.href.substring(tokenLength + 1) |
| | | // 把token存进B系统 |
| | | let obj = { |
| | | dataType: typeof (z), |
| | | content: z, |
| | | datetime: new Date().getTime() |
| | | } |
| | | window.localStorage.setItem('saber-token', JSON.stringify(obj)); |
| | | Cookies.set('saber-access-token', z) |
| | | } |
| | | |
| | | // 注册全局crud驱动 |
| | | window.$crudCommon = crudCommon; |
| | |
| | | |
| | | Vue.config.productionTip = false; |
| | | |
| | | //import Cookies from 'js-cookie' |
| | | // 携带token跳转页面设置 |
| | | |
| | | //const tokenLength = window.location.href.indexOf('='); |
| | | //if(tokenLength>0){ |
| | | // //取“=”之后的token |
| | | // let z = window.location.href.substring(tokenLength + 1) |
| | | // // 把token存进B系统 |
| | | // let obj = { |
| | | // dataType: typeof (z), |
| | | // content: z, |
| | | // datetime: new Date().getTime() |
| | | // } |
| | | // window.localStorage.setItem('saber-token', JSON.stringify(obj)); |
| | | // Cookies.set('saber-access-token', z) |
| | | //} |
| | | |
| | | new Vue({ |
| | | router, |
| | | store, |
| | |
| | | * 全站权限配置 |
| | | * |
| | | */ |
| | | import md5 from 'js-md5' |
| | | import request from '@/router/axios'; |
| | | import { Message } from 'element-ui' |
| | | |
| | | import router from './router/router' |
| | | import store from './store' |
| | | import { validatenull } from '@/util/validate' |
| | |
| | | const lockPage = store.getters.website.lockPage; //锁屏页 |
| | | router.beforeEach((to, from, next) => { |
| | | var tag = false; |
| | | if (to.fullPath.indexOf("token") > 0) { |
| | | tag = true; |
| | | } |
| | | // if (to.fullPath.indexOf("token") > 0) { |
| | | // tag = true; |
| | | // } |
| | | const meta = to.meta || {}; |
| | | const isMenu = meta.menu === undefined ? to.query.menu : meta.menu; |
| | | store.commit('SET_IS_MENU', isMenu === undefined); |
| | |
| | | next({ path: '/' }) |
| | | } else { |
| | | //如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页 |
| | | if (store.getters.token.length === 0 && tag==false) { |
| | | // if (store.getters.token.length === 0 && tag==false) { |
| | | if (store.getters.token.length === 0) { |
| | | store.dispatch('FedLogOut').then(() => { |
| | | next({ path: '/login' }) |
| | | }) |
| | |
| | | const i18n = to.query.i18n; |
| | | if (to.query.target) { |
| | | window.open(value) |
| | | } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label) && tag==false) { |
| | | } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) { |
| | | // } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label) && tag==false) { |
| | | store.commit('ADD_TAG', { |
| | | label: label, |
| | | value: value, |
| | |
| | | if (meta.isAuth === false) { |
| | | next() |
| | | } else { |
| | | console.log(to.path,66666) |
| | | if (to.path == '/security/security') { |
| | | // console.log('进入首页-----') |
| | | var a = to.query.securitySupervisionSystem; |
| | | if (a == undefined || typeof a != "string") { |
| | | // console.log("无securitySupervisionSystem参数 跳回登入"); |
| | | next('/login'); |
| | | next('/login'); |
| | | return; |
| | | } |
| | | // console.log("有securitySupervisionSystem参数"); |
| | | try { |
| | | // console.log("判断securitySupervisionSystem是否能被JSOn解码"); |
| | | var obj = JSON.parse(a); |
| | | if (typeof obj == "object" && obj && obj.tokenMY == '987654321S') { |
| | | debugger |
| | | var data = { |
| | | tenantId: obj.data.dip, |
| | | username: obj.data.rese, |
| | | password: md5(obj.data.sap), |
| | | grant_type: 'password', |
| | | scope: 'all', |
| | | type: 'account' |
| | | }; |
| | | request({ |
| | | url: '/api/blade-auth/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0', |
| | | "Tenant-Id": "000000" |
| | | }, |
| | | params: data |
| | | }).then(res => { |
| | | const data = res.data; |
| | | if (data.error_description) { |
| | | // console.log("登入失败"); |
| | | Message({ |
| | | message: data.error_description, |
| | | type: 'error' |
| | | }) |
| | | next('/login'); |
| | | next('/login'); |
| | | return; |
| | | } else { |
| | | // console.log("登入成功"); |
| | | store.commit('SET_TOKEN', data.access_token); |
| | | store.commit('SET_REFRESH_TOKEN', data.refresh_token); |
| | | store.commit('SET_TENANT_ID', data.tenant_id); |
| | | store.commit('SET_USER_INFO', data); |
| | | store.commit('DEL_ALL_TAG'); |
| | | store.commit('CLEAR_LOCK'); |
| | | next(to.path); |
| | | return; |
| | | } |
| | | }) |
| | | return; |
| | | } else { |
| | | // console.log("成功解码 不是对象"); |
| | | next('/login'); |
| | | next('/login'); |
| | | return; |
| | | } |
| | | } catch { |
| | | // console.log('不是Json对象 跳回登入'); |
| | | next('/login'); |
| | | next('/login'); |
| | | return; |
| | | } |
| | | } |
| | | next('/login') |
| | | } |
| | | } |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getPage, getDetail, add, update, remove} from "@/api/community/community"; |
| | | import {getPage, getDetails, add, update, remove} from "@/api/villageInfo/villageInfo"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | { |
| | | label: "小区名", |
| | | prop: "name", |
| | | prop: "aoiName", |
| | | type: "input", |
| | | search: true, |
| | | rules: [{ |
| | |
| | | }, |
| | | { |
| | | label: "责任区", |
| | | prop: "deptId", |
| | | type: "cascader", |
| | | prop: "areaName", |
| | | addDisplay:false, |
| | | editDisplay:false, |
| | | viewDisplay:false, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属责任区", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "责任区", |
| | | prop: "areaId", |
| | | type: "tree", |
| | | emitPath:false, |
| | | dicUrl: "api/blade-system/dept/lazy-list", |
| | | hide:true, |
| | | dicUrl: "api/policeStationInfo/policeStationInfo/getPoliceStationTwoTrees", |
| | | parent:false, |
| | | props:{ |
| | | label:'deptName', |
| | | value:'id', |
| | | children:'children' |
| | | label:'name', |
| | | value:'id' |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | console.log(row,22222) |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | console.log(row,22222) |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | getDetails(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | |
| | | <script> |
| | | import { getPage, getDetail, add, update, remove } from "@/api/security/security"; |
| | | import { getUserInfos } from "@/api/system/user"; |
| | | // import AvueMap from 'avue-plugin-map'; |
| | | import { mapGetters } from "vuex"; |
| | | import securityManage from "@/views/securityManage/securityManage" |
| | |
| | | //取“=”之后的token |
| | | let z = window.location.href.substring(tokenLength + 1) |
| | | this.$store.commit('SET_TOKEN', z); |
| | | this.$store.commit('DEL_ALL_TAG'); |
| | | this.$store.commit('CLEAR_LOCK'); |
| | | this.getUserInfo() |
| | | } |
| | | }, |
| | | methods: { |
| | | getUserInfo(){ |
| | | getUserInfos().then(res=>{ |
| | | this.$store.commit('SET_USER_INFO', res.data.data); |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | |
| | | <el-button |
| | | size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | v-if="userInfo.role_name.indexOf('admin')" |
| | | icon="el-icon-setting" |
| | | @click="handlePlatform">平台配置 |
| | | </el-button> |
| | | <el-button |
| | | size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | v-if="userInfo.role_name.indexOf('admin')" |
| | | icon="el-icon-coordinate" |
| | | @click="handleLock">账号解封 |
| | | </el-button> |
| | | <el-button |
| | | size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | v-if="userInfo.role_name.indexOf('admin')" |
| | | icon="el-icon-upload2" |
| | | @click="handleImport">导入 |
| | | </el-button> |
| | | <el-button |
| | | size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | v-if="userInfo.role_name.indexOf('admin')" |
| | | icon="el-icon-download" |
| | | @click="handleExport">导出 |
| | | </el-button> |
| | |
| | | label: "title" |
| | | }, |
| | | /*control:() =>{ |
| | | if (this.userInfo.role_name.includes("administrator")){ |
| | | if (this.userInfo.role_name.indexOf("administrator")){ |
| | | debugger |
| | | return{ |
| | | roleId:{ |
| | |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | getPostList(tenantId).then(res => { |
| | | const column = this.findObject(this.option.group, "postId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | //getPostList(tenantId).then(res => { |
| | | // const column = this.findObject(this.option.group, "postId"); |
| | | // column.dicData = res.data.data; |
| | | //}); |
| | | }, |
| | | submitRole() { |
| | | const roleList = this.$refs.treeRole.getCheckedKeys().join(","); |
| | |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | if (["edit", "view"].indexOf(type)) { |
| | | getUser(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | if(this.form.hasOwnProperty("deptId")){ |
| | |
| | | }); |
| | | }, |
| | | platformBeforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | if (["edit", "view"].indexOf(type)) { |
| | | getUserPlatform(this.platformForm.id).then(res => { |
| | | this.platformForm = res.data.data; |
| | | }); |
| | |
| | | proxy: { |
| | | '/api': { |
| | | //本地服务接口地址 |
| | | target: 'http://192.168.0.125:82/', |
| | | target: 'http://localhost:82/', |
| | | //远程演示服务地址,可用于直接启动项目 |
| | | //target: 'https://saber.bladex.vip/api', |
| | | ws: true, |