Commit 04de1051 by 夏新然

可登录暂时版本

1 parent e056acf7
No preview for this file type
...@@ -6,10 +6,10 @@ import search from "./search"; ...@@ -6,10 +6,10 @@ import search from "./search";
import device from "./device" import device from "./device"
import resource from "./resource" import resource from "./resource"
import ops from "./ops" import ops from "./ops"
let wsIP = "192.168.9.133:20080"; let wsIP = "vion-panda.51vip.biz:52510";
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
wsIP = "192.168.9.133:20080"; // 测试环境url wsIP = "vion-panda.51vip.biz:52510"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
break; break;
case "pre": case "pre":
......
...@@ -17,7 +17,7 @@ service.interceptors.request.use( ...@@ -17,7 +17,7 @@ service.interceptors.request.use(
} }
if (config.method == 'get') { if (config.method == 'get') {
config.params = { config.params = {
_t: Date.parse(new Date()) / 1000, // _t: Date.parse(new Date()) / 1000,
...config.params ...config.params
} }
} }
......
...@@ -6,5 +6,6 @@ export default { ...@@ -6,5 +6,6 @@ export default {
cates: baseUrl + "/api/v1/codes/traffic/cates", cates: baseUrl + "/api/v1/codes/traffic/cates",
codes: baseUrl + "/api/v1/codes/traffic/cates/", codes: baseUrl + "/api/v1/codes/traffic/cates/",
customCode:baseUrl + "/api/v1/codes/custom/cates", customCode:baseUrl + "/api/v1/codes/custom/cates",
menus:baseUrl + "/api/v1/auth/menu_tree" menus:baseUrl + "/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus"
// getApps:baseUrl + "/api/v1/auth/apps"
}; };
...@@ -5,7 +5,7 @@ export default { ...@@ -5,7 +5,7 @@ export default {
pass:baseUrl+'/api/v1/datahandle/behavior/audit/', pass:baseUrl+'/api/v1/datahandle/behavior/audit/',
delResult:baseUrl+'/api/v1/datahandle/behavior/events/', delResult:baseUrl+'/api/v1/datahandle/behavior/events/',
delEvent:baseUrl+'/api/v1/datahandle/behavior/archive/', delEvent:baseUrl+'/api/v1/datahandle/behavior/archive/',
eventTypeData:'http://192.168.9.133:20080'+'/api/v1/codes/event_types', eventTypeData:baseUrl+'/api/v1/codes/event_types',
homeNum:baseUrl+'/api/v1/datahandle/statistics/type', homeNum:baseUrl+'/api/v1/datahandle/statistics/type',
homeLine:baseUrl+'/api/v1/datahandle/statistics/hour', homeLine:baseUrl+'/api/v1/datahandle/statistics/hour',
homeCatch:baseUrl+'/api/v1/datahandle/statistics/handle', homeCatch:baseUrl+'/api/v1/datahandle/statistics/handle',
......
import api from '../index' import api from '../index'
import baseUrl from '../baseUrl' import baseUrl from '../baseUrl'
export default { export default {
getUserList(params){ getUserList(params,id){
return api.get(`${baseUrl}/api/v1/devconf_fx/users`, params) return api.get(`${baseUrl}/api/v1/auth/users/${id}`, params)
}, },
getRoleList(params,id) { getRoleList(params,id) {
return api.get(`${baseUrl}/api/v1/devconf_fx/roles`, params) return api.get(`${baseUrl}/api/v1/auth/roles`, params)
}, },
addUser(params){ addUser(params){
return api.post(`${baseUrl}/api/v1/devconf_fx/users`, params) return api.post(`${baseUrl}/api/v1/auth/users`, params)
}, },
editUser(params,id) { editUser(params,id) {
return api.post(`${baseUrl}/api/v1/devconf_fx/users/${id}`, params) return api.post(`${baseUrl}/api/v1/devconf_fx/users/${id}`, params)
...@@ -23,9 +23,12 @@ export default { ...@@ -23,9 +23,12 @@ export default {
return api.get(`${baseUrl}/api/v1/devconf_fx/menu/list`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/menu/list`, params)
}, },
addRole(params){ addRole(params){
return api.post(`${baseUrl}/api/v1/devconf_fx/roles`, params) return api.post(`${baseUrl}/api/v1/auth/roles`, params)
}, },
logList(params){ logList(params){
return api.get(`${baseUrl}/api/v1/devconf_fx/logs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/logs`, params)
}, },
bindperms(params,id){
return api.post(`${baseUrl}/api/v1/auth/roles/${id}/perms`, params)
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -47,6 +47,7 @@ export default { ...@@ -47,6 +47,7 @@ export default {
uploadFile(params,id){ uploadFile(params,id){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'}) return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'})
}, },
getResource(params,id){ getResource(params,id){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params)
}, },
...@@ -56,6 +57,9 @@ export default { ...@@ -56,6 +57,9 @@ export default {
getStoreConList(params){ getStoreConList(params){
return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params)
}, },
uploadStore(params){
return api.post(`${baseUrl}/api/v1/devconf_fx/store_confs`, params,{'Content-Type': 'multipart/form-data'})
},
getSubTask(params,id){ getSubTask(params,id){
return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`, params)
}, },
......
...@@ -2,7 +2,7 @@ import api from "../index"; ...@@ -2,7 +2,7 @@ import api from "../index";
import baseUrl from "../baseUrl"; import baseUrl from "../baseUrl";
export default { export default {
getEventType() { getEventType() {
return api.get(`http://192.168.9.133:20080/api/v1/codes/event_types`); return api.get(`${baseUrl}/api/v1/codes/event_types`);
}, },
getTrafficType(params) { getTrafficType(params) {
//类型统计 //类型统计
......
...@@ -201,6 +201,13 @@ export const asyncRouterMap = [ ...@@ -201,6 +201,13 @@ export const asyncRouterMap = [
}, },
component: resolve => require(["../views/ops/role_manage.vue"], resolve), component: resolve => require(["../views/ops/role_manage.vue"], resolve),
},{ },{
path: "/ops/batch_upgrade",
name: "批量升级",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/ops/log_manage.vue"], resolve),
},{
path: "/ops/log_manage", path: "/ops/log_manage",
name: "日志管理", name: "日志管理",
meta: { meta: {
......
...@@ -36,10 +36,10 @@ function filterAsyncRouter(asyncRouterMap, roles) { ...@@ -36,10 +36,10 @@ function filterAsyncRouter(asyncRouterMap, roles) {
// return routers // return routers
asyncRouterMap.forEach((ele, index) => { asyncRouterMap.forEach((ele, index) => {
roles.map(m => { roles.map(m => {
if (ele.path == m.menu_api) { if (ele.path == m.path) {
let obj = ele; let obj = ele;
if (m.childs && m.childs.length > 0) { if (m.children && m.children.length > 0) {
obj.children = filterAsyncRouter(ele.children, m.childs); obj.children = filterAsyncRouter(ele.children, m.children);
} else { } else {
obj.children = [] obj.children = []
} }
...@@ -72,6 +72,7 @@ const menu = { ...@@ -72,6 +72,7 @@ const menu = {
commit("SET_ROUTERS", []); commit("SET_ROUTERS", []);
return; return;
} else { } else {
console.log('aaa',data)
let accessedRouters = filterAsyncRouter(asyncRouterMap, data); let accessedRouters = filterAsyncRouter(asyncRouterMap, data);
commit("SET_ROUTERS", accessedRouters); commit("SET_ROUTERS", accessedRouters);
} }
......
...@@ -46,7 +46,8 @@ import types from '../store/types.js' ...@@ -46,7 +46,8 @@ import types from '../store/types.js'
login(){ login(){
this.$api.login.login({ this.$api.login.login({
"username":this.username, "username":this.username,
"password":this.password "password":this.password,
"user_type": "user"
}).then(res => { }).then(res => {
if(!res.ecode){ if(!res.ecode){
this.$store.commit(types.ATOKEN,res.atoken); this.$store.commit(types.ATOKEN,res.atoken);
...@@ -76,10 +77,10 @@ import types from '../store/types.js' ...@@ -76,10 +77,10 @@ import types from '../store/types.js'
getMenu(id){ getMenu(id){
//获取菜单 //获取菜单
this.$api.login.getMenus({ this.$api.login.getMenus({
"app_unid":id "shape":"tree"
}).then(res=>{ }).then(res=>{
localStorage.setItem('menu', JSON.stringify(res.menu_tree)) localStorage.setItem('menu', JSON.stringify(res.menu_tree[0].children))
this.$store.dispatch('GetMenuRole',res.menu_tree).then(res => { this.$store.dispatch('GetMenuRole',res.menu_tree[0].children).then(res => {
this.$router.push('/') this.$router.push('/')
}) })
}) })
......
...@@ -266,8 +266,10 @@ ...@@ -266,8 +266,10 @@
this.addForm.menu_unids=this.$refs.addTree.getCheckedKeys().sort((a, b) => { return a - b; }); this.addForm.menu_unids=this.$refs.addTree.getCheckedKeys().sort((a, b) => { return a - b; });
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.$api.ops.addRole(this.addForm).then(res=>{ this.$api.ops.addRole({name:this.addForm.role_name}).then(res=>{
if(!res.ecode){ if(!res.ecode){
// this.$api.ops.bindperms({})
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加成功!' message: '添加成功!'
......
...@@ -164,9 +164,10 @@ ...@@ -164,9 +164,10 @@
page:1, page:1,
pageSize:30, pageSize:30,
addForm:{ addForm:{
norm_type:"login",
role_unid:'', role_unid:'',
user_name:'', username:'',
user_password:'' password:''
}, },
editForm:{ editForm:{
role_unid:'', role_unid:'',
...@@ -211,11 +212,12 @@ ...@@ -211,11 +212,12 @@
}, },
getTableList(){ getTableList(){
this.tableData=[]; this.tableData=[];
console.log('aa',this.userId)
let offset = (this.page - 1) * this.pageSize; let offset = (this.page - 1) * this.pageSize;
this.$api.ops.getUserList({ this.$api.ops.getUserList({
limit: this.pageSize, limit: this.pageSize,
offset: offset, offset: offset,
}).then((res)=>{ },this.userId).then((res)=>{
this.total=res.total_num; this.total=res.total_num;
if(res.list_data==null){ if(res.list_data==null){
...@@ -232,6 +234,7 @@ ...@@ -232,6 +234,7 @@
this.$api.ops.getRoleList({ this.$api.ops.getRoleList({
limit: 9999, limit: 9999,
offset: 0, offset: 0,
is_active:true
}).then((res)=>{ }).then((res)=>{
if(res.list_data==null){ if(res.list_data==null){
this.roleList=[] this.roleList=[]
......
...@@ -71,6 +71,36 @@ ...@@ -71,6 +71,36 @@
</div> </div>
</div> </div>
<el-dialog
title="添加"
:visible.sync="addVisible"
width="450px">
<div>
<el-form label-position="left" label-width="120px">
<el-form-item label="配置名称">
<el-input v-model="names"></el-input>
</el-form-item>
<el-form-item label="添加文件">
<el-upload
ref="upload"
action="uploadUrl"
:http-request="httpRequest"
multiple
name="file"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
</el-upload>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible=false">取 消</el-button>
<el-button type="primary" @click="save">上 传</el-button>
</span>
</el-dialog>
<el-dialog title="详情" :visible.sync="detailVisible" width="30%"> <el-dialog title="详情" :visible.sync="detailVisible" width="30%">
<div class="title">任务列表</div> <div class="title">任务列表</div>
<div class="maxHeight"> <div class="maxHeight">
...@@ -87,6 +117,10 @@ ...@@ -87,6 +117,10 @@
export default { export default {
data(){ data(){
return{ return{
addVisible:false,
uploadUrl: '',
names:'',
file:[],
props: { props: {
label: 'name', label: 'name',
children: 'child', children: 'child',
...@@ -117,6 +151,26 @@ ...@@ -117,6 +151,26 @@
this.query(); this.query();
}, },
methods:{ methods:{
// 自定义的上传函数
httpRequest(param) {
this.file=[];
// 一般情况下是在这里创建FormData对象,但我们需要上传多个文件,为避免发送多次请求,因此在这里只进行文件的获取,param可以拿到文件上传的所有信息
this.file.push(param.file)
},
save(){
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
// 最重要的就是这段代码
var upData = new FormData() // 首先创建FormData对象
this.file.forEach((file)=>{
upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append('name', this.names);
upData.append("is_temp", 0);
})
this.$api.resource.uploadStore(upData).then(res=>{
this.query();
})
},
loadNode(node, resolve) { loadNode(node, resolve) {
if (node.level === 0) { if (node.level === 0) {
return resolve(this.curentSubList); return resolve(this.curentSubList);
...@@ -164,7 +218,7 @@ ...@@ -164,7 +218,7 @@
}) })
}, },
add(){ add(){
this.addVisible=true;
}, },
taskFormatter(row, column, cellValue, index){ taskFormatter(row, column, cellValue, index){
let columnText=''; let columnText='';
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
action="uploadUrl" action="uploadUrl"
:http-request="httpRequest" :http-request="httpRequest"
multiple multiple
:data="uploadData"
name="file" name="file"
:auto-upload="false"> :auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
...@@ -63,10 +62,6 @@ ...@@ -63,10 +62,6 @@
childs: [] childs: []
} }
], ],
uploadData:{
vchan_type:'vfile',
vchan_refid:new Date().getTime()
},
defaultProps:{ defaultProps:{
children: "childs", children: "childs",
disabled: "disabled", disabled: "disabled",
...@@ -123,19 +118,8 @@ ...@@ -123,19 +118,8 @@
upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行 upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行
upData.append('name', file.name); upData.append('name', file.name);
upData.append('vchan_type', 'vfile'); upData.append('vchan_type', 'vfile');
upData.append('vchan_refid', '11111111'); upData.append('vchan_refid', new Date().getTime());
}) })
console.log(upData.getAll('file'))
// this.axios.post('http://192.168.9.133:20080/api/v1/devconf_fx/devs/'+this.devsId+'/vfile_vchans', upData, {
// headers: {
// 'Content-Type': 'multipart/form-data',
// },
// }).then(res => {
// console.log(res);
// }).catch(err => {
// console.log(err);
// });
this.$api.resource.uploadFile(upData,this.devsId).then(res=>{ this.$api.resource.uploadFile(upData,this.devsId).then(res=>{
console.log(res) console.log(res)
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!