diff --git a/config/index.js b/config/index.js index ec4d01a9f899bb92065618225d6012fb3572892c..56ca4d83b15ade490499e3b15fddaa775d69a1ca 100644 --- a/config/index.js +++ b/config/index.js @@ -12,7 +12,7 @@ module.exports = { assetsPublicPath: '/', proxyTable: { '/api': { - target: 'http://localhost:10001', // 你请求的第三方接口 + target: 'http://localhost:8081', // 你请求的第三方接口 changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题 pathRewrite: { // 路径重写, '^/api': '' // 替换target中的请求地址,也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。 @@ -74,4 +74,4 @@ module.exports = { // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report } -} \ No newline at end of file +} diff --git a/src/api/axiosFun.js b/src/api/axiosFun.js index 8d7b7d85d47af1930a4893e2170fef5f5055b9cb..e4e1dd08afbf344b9d5a741092c5e17f416c34ce 100644 --- a/src/api/axiosFun.js +++ b/src/api/axiosFun.js @@ -33,7 +33,7 @@ const req = (method, url, params) => { headers: { // 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/json', - token: localStorage.getItem('logintoken') + token: localStorage.getItem('token') }, data: params, traditional: true, @@ -49,11 +49,11 @@ const req = (method, url, params) => { // } // return ret // } - // ] + // ] }).then(res => res.data); }; export { loginreq, req -} \ No newline at end of file +} diff --git a/src/api/userMG.js b/src/api/userMG.js index 25181f4397c172ee4ffe0765668253892e68e303..595dfe06fbaeb03ebd1c21e18280e035d22401da 100644 --- a/src/api/userMG.js +++ b/src/api/userMG.js @@ -1,15 +1,15 @@ import axios from 'axios'; import { loginreq, req } from './axiosFun'; -// 登录接口 -export const login = (params) => { return loginreq("post", "/api/login", params) }; +// 登录接口 +export const login = (params) => { return axios.get("/api/login/login?&username=" + params.username +"&userpwd="+params.userpwd).then(res => res.data) }; // 获取用户菜单 export const menu = (params) => { return axios.get("/api/menu?&token=" + localStorage.getItem('logintoken')).then(res => res.data) }; // 退出接口 export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) }; /** - * 用户管理 + * 用户管理 **/ // 用户管理-获取用户列表 export const userList = (params) => { return req("post", "/api/User/list", params) }; @@ -35,7 +35,7 @@ export const userExpireToken = (params) => { return req("get", "/api/User/expire export const userFlashCache = (params) => { return req("get", "/api/User/flashCache/" + params, {}) }; /** - * 模型tag管理 + * 模型tag管理 **/ // 模型tag管理-获取tag列表 export const ModelTagList = (params) => { return req("get", "http://127.0.0.1:10001/modelTagInfo/list?pageNum="+params.pageNum+"&pageSize="+params.pageSize+"&modelTag="+params.modelTag)}; @@ -47,9 +47,21 @@ export const ModelTagAllList = () => { return req("get", "http://127.0.0.1:10001 export const ModelTagSave = (params) => { return req("post", "http://127.0.0.1:10001/modelTagInfo/saveOrUpdate", params) }; // 模型tag管理-删除tag export const ModelTagDelete = (params) => { return req("post", "http://127.0.0.1:10001/modelTagInfo/delete", params) }; +/** + * 发票管理 + **/ +// 发票管理-获取发票列表 + +export const FapiaoList = (params) => { return req("get", "http://localhost:9999/api/bill/selectAll?current="+params.pageNum+"&size="+params.pageSize+"&baoxiaoname="+params.baoxiaoname+"&billnum="+params.billnum)}; +// // 发票管理-根据Id获取发票 +// export const getFapiaoById = (params) => { return req("get", "http://127.0.0.1:10001/modelTagInfo/detail?id="+params.modelTagId)}; +// 发票管理-获取发票列表 +export const FapiaoAllList = () => { return req("get", "http://127.0.0.1:10001/modelTagInfo/selectAll")}; +// 发票管理-保存(添加编辑) +export const FapiaoSave = (params) => { return req("post", "http://localhost:9999/api/bill/insert", params) }; /** - * 模型管理 + * 模型管理 **/ // 根据模型id查询tagId export const getTagIdByModelId = (id) => { return req("get", "http://127.0.0.1:10001/modelInfo/getTagIdByModelId?id="+id)}; @@ -80,7 +92,7 @@ export const modelUpload=(formData)=>{ }).then(res => res.data);}; // 上传数据集文件接口 -export const FileUplod = (formData) => { +export const FileUplod = (formData) => { return axios( { method: "post", @@ -104,7 +116,7 @@ export const ModelDataDetail = (param) => { return req("get", "http://127.0.0.1: // 根据模型id查询数据集列表 export const ModelDataListByModelId = (param) => { return req("get", "http://127.0.0.1:10001/modelDataInfo/getByModelId?modelId="+param)}; /** - * 算法配置管理 + * 算法配置管理 **/ // 获取算法配置列表 export const configList = (params) => { return req("get", "http://127.0.0.1:10001/config/list?pageNum="+params.pageNum+"&pageSize="+params.pageSize+"&modelConfigName="+params.modelConfigName)}; @@ -145,7 +157,7 @@ export const ModuleSave = (params) => { return req("post", "/api/Module/save", p export const ModuleDelete = (params) => { return axios.delete("/api/Module/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) }; /** - * 角色管理 + * 角色管理 **/ // 角色管理-获取角色列表 export const roleList = (params) => { return req("post", "/api/Role/list", params) }; @@ -159,7 +171,7 @@ export const RoleRightTree = (params) => { return axios.get("/api/RoleRight/tree export const RoleRightSave = (params) => { return req("post", "/api/RoleRight/save", params) }; /** - * 公司管理 + * 公司管理 **/ // 公司管理-获取公司列表 export const deptList = (params) => { return req("post", "/api/Dept/list", params) }; @@ -169,7 +181,7 @@ export const deptSave = (params) => { return req("post", "/api/Dept/save", param export const deptDelete = (params) => { return axios.get("/api/Dept/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) }; /** - * 系统环境变量 + * 系统环境变量 **/ // 系统环境变量-获取系统环境变量列表 export const variableList = (params) => { return req("post", "/api/Variable/list", params) }; @@ -179,7 +191,7 @@ export const variableSave = (params) => { return req("post", "/api/Variable/save export const variableDelete = (params) => { return axios.delete("/api/Variable/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) }; /** - * 权限管理 + * 权限管理 **/ // 权限管理-获取权限列表 export const permissionList = (params) => { return req("post", "/api/Permission/list", params) }; @@ -190,4 +202,4 @@ export const ermissionDelete = (params) => { return axios.delete("/api/Permissio // 权限管理-获取权限 export const roleDropDown = () => { return axios.get("/api/Role/dropDown/all?&token=" + localStorage.getItem('logintoken')).then(res => res.data) }; // 权限管理-配置权限 -export const RolePermission = (params) => { return req("post", "/api/RolePermission/save", params) }; \ No newline at end of file +export const RolePermission = (params) => { return req("post", "/api/RolePermission/save", params) }; diff --git a/src/components/leftnav.vue b/src/components/leftnav.vue index 891a622256ee36f825702015818a45a6f4164044..c70912d07a813a1768ce839e7214fa56b2098c5f 100644 --- a/src/components/leftnav.vue +++ b/src/components/leftnav.vue @@ -1,6 +1,6 @@ /** * 左边菜单 -*/ +*/ @@ -40,62 +40,79 @@ export default { let res = { success: true, data: [ + // { + // menuid: 1, + // icon: 'li-icon-xiangmuguanli', + // menuname: '算法配置管理', + // hasThird: null, + // url: null, + // menus: [ + // { + // menuid: 2, + // icon: 'icon-cat-skuQuery', + // menuname: '模型实例列表', + // hasThird: 'N', + // url: 'algorithm/Algorithm', + // menus: null + // }, + // + // ] + // }, + // { + // menuid: 33, + // icon: 'li-icon-dingdanguanli', + // menuname: '模型管理', + // hasThird: null, + // url: null, + // menus: [ + // { + // menuid: 34, + // icon: 'icon-order-manage', + // menuname: '模型列表', + // hasThird: 'N', + // url: 'models/Model', + // menus: null + // }, + // { + // menuid: 35, + // icon: 'icon-order-manage', + // menuname: '模型标签列表', + // hasThird: 'N', + // url: 'models/Tag', + // menus: null + // } + // ] + // }, + // { + // menuid: 71, + // icon: 'li-icon-xitongguanli', + // menuname: '数据集管理', + // hasThird: null, + // url: null, + // menus: [ + // { + // menuid: 72, + // icon: 'icon-cus-manage', + // menuname: '数据集列表', + // hasThird: 'N', + // url: 'datasets/Dataset', + // menus: null + // }, + // ] + // } { - menuid: 1, - icon: 'li-icon-xiangmuguanli', - menuname: '算法配置管理', - hasThird: null, - url: null, - menus: [ - { - menuid: 2, - icon: 'icon-cat-skuQuery', - menuname: '模型实例列表', - hasThird: 'N', - url: 'algorithm/Algorithm', - menus: null - }, - - ] - }, - { - menuid: 33, - icon: 'li-icon-dingdanguanli', - menuname: '模型管理', - hasThird: null, - url: null, - menus: [ - { - menuid: 34, - icon: 'icon-order-manage', - menuname: '模型列表', - hasThird: 'N', - url: 'models/Model', - menus: null - }, - { - menuid: 35, - icon: 'icon-order-manage', - menuname: '模型标签列表', - hasThird: 'N', - url: 'models/Tag', - menus: null - } - ] - }, - { - menuid: 71, + menuid: 72, icon: 'li-icon-xitongguanli', - menuname: '数据集管理', + menuname: '发票管理', hasThird: null, url: null, menus: [ { menuid: 72, icon: 'icon-cus-manage', - menuname: '数据集列表', + menuname: '发票管理列表', hasThird: 'N', - url: 'datasets/Dataset', + url: 'fapiao/Fapiao', menus: null }, ] @@ -104,20 +121,20 @@ export default { msg: 'success' } this.allmenu = res.data - - // menu(localStorage.getItem('logintoken')) - // .then(res => { - // console.log(JSON.stringify(res)) - // if (res.success) { - // this.allmenu = res.data - // } else { - // this.$message.error(res.msg) - // return false - // } - // }) - // .catch(err => { - // this.$message.error('菜单加载失败,请稍后再试!') - // }) + + menu(localStorage.getItem('token')) + .then(res => { + console.log(JSON.stringify(res)) + if (res.success) { + this.allmenu = res.data + } else { + this.$message.error(res.msg) + return false + } + }) + .catch(err => { + this.$message.error('菜单加载失败,请稍后再试!') + }) // 监听是否收缩侧边栏 this.$root.Bus.$on('toggle', value => { this.collapsed = !value @@ -154,4 +171,4 @@ export default { .logoimg { height: 40px; } - \ No newline at end of file + diff --git a/src/main.js b/src/main.js index 04888fee56617ce091381a131d91929171121b01..17d6ec03ec802b704a3849c4504bb1c5f101948e 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,7 @@ import router from './router'; import store from './vuex/store'; // 引入icon import './assets/icon/iconfont.css' -// +// @@ -51,10 +51,10 @@ router.beforeEach((to, from, next) => { next(); } else { /** - * 防刷新,如果登录,修改路由跳转到登录页面,修改路由为登录后的首页 + * 防刷新,如果登录,修改路由跳转到登录页面,修改路由为登录后的首页 */ next({ - path: '/algorithm/Algorithm' + path: '/fapiao/Fapiao' }) } } else { @@ -81,4 +81,4 @@ new Vue({ Bus: new Vue() } -}) \ No newline at end of file +}) diff --git a/src/router/index.js b/src/router/index.js index f65a47da73feb9a39bdf5078c18f3d5a5226279f..e2a54ed02cdde91dfd92dfab8e14dbf853bb5b4d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -24,12 +24,14 @@ import datasets from '@/views/datasets/Dataset'; import tags from '@/views/models/Tag'; +import fapiao from '@/views/fapiao/Fapiao'; + // 启用路由 Vue.use(Router); -// 导出路由 +// 导出路由 export default new Router({ routes: [{ path: '/', @@ -39,8 +41,8 @@ export default new Router({ meta: { requireAuth: false } - }, - + }, + { path: '/login', name: '登录', @@ -57,14 +59,14 @@ export default new Router({ component: index, iconCls: 'el-icon-tickets', children: [ - { + { path: '/algorithm/Algorithm', name: '算法配置管理', component: Algorithm, meta: { requireAuth: true }, - }, + }, { path: '/algorithm/ModelTest', @@ -73,8 +75,8 @@ export default new Router({ meta: { requireAuth: true }, - }, - + }, + { path: '/models/Model', name: '模型管理', @@ -82,7 +84,7 @@ export default new Router({ meta: { requireAuth: true } - }, + }, { path: '/models/modelEdit', name: '模型详情', @@ -107,6 +109,22 @@ export default new Router({ requireAuth: true } }, + { + path: '/fapiao/Fapiao', + name: '发票查询', + component: fapiao, + meta: { + requireAuth: true + } + }, + // { + // path: '/fapiao/Dataset', + // name: '数据集管理', + // component: fapiao, + // meta: { + // requireAuth: true + // } + // }, ] }] -}) \ No newline at end of file +}) diff --git a/src/views/fapiao/Fapiao.vue b/src/views/fapiao/Fapiao.vue new file mode 100644 index 0000000000000000000000000000000000000000..c7356dfeea68676a1fe2bda5eddcbc6ef5e548c8 --- /dev/null +++ b/src/views/fapiao/Fapiao.vue @@ -0,0 +1,536 @@ + + + + + + diff --git a/src/views/login.vue b/src/views/login.vue index bac819aab4be4d14107adc312d5a047897742b97..11ec4b9c4bb43cf0cc7419a6e7ff0329226122ad 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -8,7 +8,7 @@ - + - 记住密码 + 登录 @@ -42,7 +42,7 @@ export default { ruleForm: { //username和password默认为空 username: '', - password: '', + userpwd: '', code: '', randomStr: '', codeimg: '' @@ -50,7 +50,7 @@ export default { //rules前端验证 rules: { username: [{ required: true, message: '请输入账号', trigger: 'blur' }], - password: [{ required: true, message: '请输入密码', trigger: 'blur' }], + userpwd: [{ required: true, message: '请输入密码', trigger: 'blur' }], code: [{ required: true, message: '请输入验证码', trigger: 'blur' }] } } @@ -65,7 +65,7 @@ export default { this.getcode() // 获取存在本地的用户名密码 this.getuserpwd() - + }, // 里面的函数只有调用才会执行 methods: { @@ -82,43 +82,43 @@ export default { // 表单验证通过,执行提交操作 this.$refs[formName].validate(valid => { - + if (valid) { - this.logining = true - // 测试通道,不为空直接登录 - setTimeout(() => { - this.logining = false - this.$store.commit('login', 'true') - this.$router.push({ path: '/algorithm/Algorithm' }) - }, 1000) + // this.logining = true + // // 测试通道,不为空直接登录 + // setTimeout(() => { + // this.logining = false + // this.$store.commit('login', 'true') + // this.$router.push({ path: '/login/login' }) + // }, 1000) // 注释 - // login(this.ruleForm).then(res => { - // if (res.success) { - // if (this.rememberpwd) { - // //保存帐号到cookie,有效期7天 - // setCookie('user', this.ruleForm.username, 7) - // //保存密码到cookie,有效期7天 - // setCookie('pwd', this.ruleForm.password, 7) - // } else { - // delCookie('user') - // delCookie('pwd') - // } - // //如果请求成功就让他2秒跳转路由 - // setTimeout(() => { - // this.logining = false - // // 缓存token - // localStorage.setItem('logintoken', res.data.token) - // // 缓存用户个人信息 - // localStorage.setItem('userdata', JSON.stringify(res.data)) - // this.$store.commit('login', 'true') - // this.$router.push({ path: '/goods/Goods' }) - // }, 1000) - // } else { - // this.$message.error(res.msg) - // this.logining = false - // return false - // } - // }) + login(this.ruleForm).then(res => { + if (res.code==0) { + if (this.rememberpwd) { + //保存帐号到cookie,有效期7天 + setCookie('user', this.ruleForm.username, 7) + //保存密码到cookie,有效期7天 + setCookie('pwd', this.ruleForm.password, 7) + } else { + delCookie('user') + delCookie('pwd') + } + //如果请求成功就让他2秒跳转路由 + setTimeout(() => { + this.logining = false + // 缓存token + localStorage.setItem('token', res.data.token) + // 缓存用户个人信息 + localStorage.setItem('userdata', JSON.stringify(res.data)) + this.$store.commit('login', 'true') + this.$router.push({ path: '/goods/Goods' }) + }, 1000) + } else { + this.$message.error(res.msg) + this.logining = false + return false + } + }) } else { // 获取图形验证码 // this.getcode() @@ -168,4 +168,4 @@ export default { .codeimg { height: 40px; } - \ No newline at end of file +