- {{ item.name }}
-
-
- diff --git a/PC/InterFace.Dash/mock/article.js b/PC/InterFace.Dash/mock/article.js deleted file mode 100644 index 23d8ba5..0000000 --- a/PC/InterFace.Dash/mock/article.js +++ /dev/null @@ -1,116 +0,0 @@ -const Mock = require('mockjs') - -const List = [] -const count = 100 - -const baseContent = '
I am testing data, I am testing data.
' -const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3' - -for (let i = 0; i < count; i++) { - List.push(Mock.mock({ - id: '@increment', - timestamp: +Mock.Random.date('T'), - author: '@first', - reviewer: '@first', - title: '@title(5, 10)', - content_short: 'mock data', - content: baseContent, - forecast: '@float(0, 100, 2, 2)', - importance: '@integer(1, 3)', - 'type|1': ['CN', 'US', 'JP', 'EU'], - 'status|1': ['published', 'draft'], - display_time: '@datetime', - comment_disabled: true, - pageviews: '@integer(300, 5000)', - image_uri, - platforms: ['a-platform'] - })) -} - -module.exports = [ - { - url: '/vue-element-admin/article/list', - type: 'get', - response: config => { - const { importance, type, title, page = 1, limit = 20, sort } = config.query - - let mockList = List.filter(item => { - if (importance && item.importance !== +importance) return false - if (type && item.type !== type) return false - if (title && item.title.indexOf(title) < 0) return false - return true - }) - - if (sort === '-id') { - mockList = mockList.reverse() - } - - const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1)) - - return { - code: 20000, - data: { - total: mockList.length, - items: pageList - } - } - } - }, - - { - url: '/vue-element-admin/article/detail', - type: 'get', - response: config => { - const { id } = config.query - for (const article of List) { - if (article.id === +id) { - return { - code: 20000, - data: article - } - } - } - } - }, - - { - url: '/vue-element-admin/article/pv', - type: 'get', - response: _ => { - return { - code: 20000, - data: { - pvData: [ - { key: 'PC', pv: 1024 }, - { key: 'mobile', pv: 1024 }, - { key: 'ios', pv: 1024 }, - { key: 'android', pv: 1024 } - ] - } - } - } - }, - - { - url: '/vue-element-admin/article/create', - type: 'post', - response: _ => { - return { - code: 20000, - data: 'success' - } - } - }, - - { - url: '/vue-element-admin/article/update', - type: 'post', - response: _ => { - return { - code: 20000, - data: 'success' - } - } - } -] - diff --git a/PC/InterFace.Dash/mock/index.js b/PC/InterFace.Dash/mock/index.js deleted file mode 100644 index 2eed65d..0000000 --- a/PC/InterFace.Dash/mock/index.js +++ /dev/null @@ -1,60 +0,0 @@ -const Mock = require('mockjs') -const { param2Obj } = require('./utils') - -const user = require('./user') -const role = require('./role') -const article = require('./article') -const search = require('./remote-search') - -const mocks = [ - ...user, - ...role, - ...article, - ...search -] - -// for front mock -// please use it cautiously, it will redefine XMLHttpRequest, -// which will cause many of your third-party libraries to be invalidated(like progress event). -function mockXHR() { - // mock patch - // https://github.com/nuysoft/Mock/issues/300 - Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send - Mock.XHR.prototype.send = function() { - if (this.custom.xhr) { - this.custom.xhr.withCredentials = this.withCredentials || false - - if (this.responseType) { - this.custom.xhr.responseType = this.responseType - } - } - this.proxy_send(...arguments) - } - - function XHR2ExpressReqWrap(respond) { - return function(options) { - let result = null - if (respond instanceof Function) { - const { body, type, url } = options - // https://expressjs.com/en/4x/api.html#req - result = respond({ - method: type, - body: JSON.parse(body), - query: param2Obj(url) - }) - } else { - result = respond - } - return Mock.mock(result) - } - } - - for (const i of mocks) { - Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response)) - } -} - -module.exports = { - mocks, - mockXHR -} diff --git a/PC/InterFace.Dash/mock/mock-server.js b/PC/InterFace.Dash/mock/mock-server.js deleted file mode 100644 index 0dca8d3..0000000 --- a/PC/InterFace.Dash/mock/mock-server.js +++ /dev/null @@ -1,84 +0,0 @@ -const chokidar = require('chokidar') -const bodyParser = require('body-parser') -const chalk = require('chalk') -const path = require('path') -const Mock = require('mockjs') - -const mockDir = path.join(process.cwd(), 'mock') - -function registerRoutes(app) { - let mockLastIndex - const { mocks } = require('./index.js') - const mocksForServer = mocks.map(route => { - return responseFake(route.url, route.type, route.response) - }) - for (const mock of mocksForServer) { - // app[mock.type](mock.url, mock.response) - app[mock.type](mock.url, bodyParser.json(),bodyParser.urlencoded({ //添加 - extended:true - }),mock.response) - mockLastIndex = app._router.stack.length - } - const mockRoutesLength = Object.keys(mocksForServer).length - return { - mockRoutesLength: mockRoutesLength, - mockStartIndex: mockLastIndex - mockRoutesLength - } -} - -function unregisterRoutes() { - Object.keys(require.cache).forEach(i => { - if (i.includes(mockDir)) { - delete require.cache[require.resolve(i)] - } - }) -} - -// for mock server -const responseFake = (url, type, respond) => { - return { - url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), - type: type || 'get', - response(req, res) { - console.log('request invoke:' + req.path) - res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) - } - } -} - -module.exports = app => { - // parse app.body - // https://expressjs.com/en/4x/api.html#req.body -// app.use(bodyParser.json()) -// app.use(bodyParser.urlencoded({ -// extended: true -// })) - - const mockRoutes = registerRoutes(app) - var mockRoutesLength = mockRoutes.mockRoutesLength - var mockStartIndex = mockRoutes.mockStartIndex - - // watch files, hot reload mock server - chokidar.watch(mockDir, { - ignored: /mock-server/, - ignoreInitial: true - }).on('all', (event, path) => { - if (event === 'change' || event === 'add') { - try { - // remove mock routes stack - app._router.stack.splice(mockStartIndex, mockRoutesLength) - - // clear routes cache - unregisterRoutes() - - const mockRoutes = registerRoutes(app) - mockRoutesLength = mockRoutes.mockRoutesLength - mockStartIndex = mockRoutes.mockStartIndex - - console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) - } catch (error) { - console.log(chalk.redBright(error)) - } - } - }) -} diff --git a/PC/InterFace.Dash/mock/remote-search.js b/PC/InterFace.Dash/mock/remote-search.js deleted file mode 100644 index 8fc4926..0000000 --- a/PC/InterFace.Dash/mock/remote-search.js +++ /dev/null @@ -1,51 +0,0 @@ -const Mock = require('mockjs') - -const NameList = [] -const count = 100 - -for (let i = 0; i < count; i++) { - NameList.push(Mock.mock({ - name: '@first' - })) -} -NameList.push({ name: 'mock-Pan' }) - -module.exports = [ - // username search - { - url: '/vue-element-admin/search/user', - type: 'get', - response: config => { - const { name } = config.query - const mockNameList = NameList.filter(item => { - const lowerCaseName = item.name.toLowerCase() - return !(name && lowerCaseName.indexOf(name.toLowerCase()) < 0) - }) - return { - code: 20000, - data: { items: mockNameList } - } - } - }, - - // transaction list - { - url: '/vue-element-admin/transaction/list', - type: 'get', - response: _ => { - return { - code: 20000, - data: { - total: 20, - 'items|20': [{ - order_no: '@guid()', - timestamp: +Mock.Random.date('T'), - username: '@name()', - price: '@float(1000, 15000, 0, 2)', - 'status|1': ['success', 'pending'] - }] - } - } - } - } -] diff --git a/PC/InterFace.Dash/mock/role/index.js b/PC/InterFace.Dash/mock/role/index.js deleted file mode 100644 index 4643f00..0000000 --- a/PC/InterFace.Dash/mock/role/index.js +++ /dev/null @@ -1,98 +0,0 @@ -const Mock = require('mockjs') -const { deepClone } = require('../utils') -const { asyncRoutes, constantRoutes } = require('./routes.js') - -const routes = deepClone([...constantRoutes, ...asyncRoutes]) - -const roles = [ - { - key: 'admin', - name: 'admin', - description: 'Super Administrator. Have access to view all pages.', - routes: routes - }, - { - key: 'editor', - name: 'editor', - description: 'Normal Editor. Can see all pages except permission page', - routes: routes.filter(i => i.path !== '/permission')// just a mock - }, - { - key: 'visitor', - name: 'visitor', - description: 'Just a visitor. Can only see the home page and the document page', - routes: [{ - path: '', - redirect: 'dashboard', - children: [ - { - path: 'dashboard', - name: 'Dashboard', - meta: { title: 'dashboard', icon: 'dashboard' } - } - ] - }] - } -] - -module.exports = [ - // mock get all routes form server - { - url: '/vue-element-admin/routes', - type: 'get', - response: _ => { - return { - code: 20000, - data: routes - } - } - }, - - // mock get all roles form server - { - url: '/vue-element-admin/roles', - type: 'get', - response: _ => { - return { - code: 20000, - data: roles - } - } - }, - - // add role - { - url: '/vue-element-admin/role', - type: 'post', - response: { - code: 20000, - data: { - key: Mock.mock('@integer(300, 5000)') - } - } - }, - - // update role - { - url: '/vue-element-admin/role/[A-Za-z0-9]', - type: 'put', - response: { - code: 20000, - data: { - status: 'success' - } - } - }, - - // delete role - { - url: '/vue-element-admin/role/[A-Za-z0-9]', - type: 'delete', - response: { - code: 20000, - data: { - status: 'success' - } - } - } -] diff --git a/PC/InterFace.Dash/mock/role/routes.js b/PC/InterFace.Dash/mock/role/routes.js deleted file mode 100644 index d33f162..0000000 --- a/PC/InterFace.Dash/mock/role/routes.js +++ /dev/null @@ -1,530 +0,0 @@ -// Just a mock data - -const constantRoutes = [ - { - path: '/redirect', - component: 'layout/Layout', - hidden: true, - children: [ - { - path: '/redirect/:path*', - component: 'views/redirect/index' - } - ] - }, - { - path: '/login', - component: 'views/login/index', - hidden: true - }, - { - path: '/auth-redirect', - component: 'views/login/auth-redirect', - hidden: true - }, - { - path: '/404', - component: 'views/error-page/404', - hidden: true - }, - { - path: '/401', - component: 'views/error-page/401', - hidden: true - }, - { - path: '', - component: 'layout/Layout', - redirect: 'dashboard', - children: [ - { - path: 'dashboard', - component: 'views/dashboard/index', - name: 'Dashboard', - meta: { title: 'Dashboard', icon: 'dashboard', affix: true } - } - ] - }, - { - path: '/documentation', - component: 'layout/Layout', - children: [ - { - path: 'index', - component: 'views/documentation/index', - name: 'Documentation', - meta: { title: 'Documentation', icon: 'documentation', affix: true } - } - ] - }, - { - path: '/guide', - component: 'layout/Layout', - redirect: '/guide/index', - children: [ - { - path: 'index', - component: 'views/guide/index', - name: 'Guide', - meta: { title: 'Guide', icon: 'guide', noCache: true } - } - ] - } -] - -const asyncRoutes = [ - { - path: '/permission', - component: 'layout/Layout', - redirect: '/permission/index', - alwaysShow: true, - meta: { - title: 'Permission', - icon: 'lock', - roles: ['admin', 'editor'] - }, - children: [ - { - path: 'page', - component: 'views/permission/page', - name: 'PagePermission', - meta: { - title: 'Page Permission', - roles: ['admin'] - } - }, - { - path: 'directive', - component: 'views/permission/directive', - name: 'DirectivePermission', - meta: { - title: 'Directive Permission' - } - }, - { - path: 'role', - component: 'views/permission/role', - name: 'RolePermission', - meta: { - title: 'Role Permission', - roles: ['admin'] - } - } - ] - }, - - { - path: '/icon', - component: 'layout/Layout', - children: [ - { - path: 'index', - component: 'views/icons/index', - name: 'Icons', - meta: { title: 'Icons', icon: 'icon', noCache: true } - } - ] - }, - - { - path: '/components', - component: 'layout/Layout', - redirect: 'noRedirect', - name: 'ComponentDemo', - meta: { - title: 'Components', - icon: 'component' - }, - children: [ - { - path: 'tinymce', - component: 'views/components-demo/tinymce', - name: 'TinymceDemo', - meta: { title: 'Tinymce' } - }, - { - path: 'markdown', - component: 'views/components-demo/markdown', - name: 'MarkdownDemo', - meta: { title: 'Markdown' } - }, - { - path: 'json-editor', - component: 'views/components-demo/json-editor', - name: 'JsonEditorDemo', - meta: { title: 'Json Editor' } - }, - { - path: 'split-pane', - component: 'views/components-demo/split-pane', - name: 'SplitpaneDemo', - meta: { title: 'SplitPane' } - }, - { - path: 'avatar-upload', - component: 'views/components-demo/avatar-upload', - name: 'AvatarUploadDemo', - meta: { title: 'Avatar Upload' } - }, - { - path: 'dropzone', - component: 'views/components-demo/dropzone', - name: 'DropzoneDemo', - meta: { title: 'Dropzone' } - }, - { - path: 'sticky', - component: 'views/components-demo/sticky', - name: 'StickyDemo', - meta: { title: 'Sticky' } - }, - { - path: 'count-to', - component: 'views/components-demo/count-to', - name: 'CountToDemo', - meta: { title: 'Count To' } - }, - { - path: 'mixin', - component: 'views/components-demo/mixin', - name: 'ComponentMixinDemo', - meta: { title: 'componentMixin' } - }, - { - path: 'back-to-top', - component: 'views/components-demo/back-to-top', - name: 'BackToTopDemo', - meta: { title: 'Back To Top' } - }, - { - path: 'drag-dialog', - component: 'views/components-demo/drag-dialog', - name: 'DragDialogDemo', - meta: { title: 'Drag Dialog' } - }, - { - path: 'drag-select', - component: 'views/components-demo/drag-select', - name: 'DragSelectDemo', - meta: { title: 'Drag Select' } - }, - { - path: 'dnd-list', - component: 'views/components-demo/dnd-list', - name: 'DndListDemo', - meta: { title: 'Dnd List' } - }, - { - path: 'drag-kanban', - component: 'views/components-demo/drag-kanban', - name: 'DragKanbanDemo', - meta: { title: 'Drag Kanban' } - } - ] - }, - { - path: '/charts', - component: 'layout/Layout', - redirect: 'noRedirect', - name: 'Charts', - meta: { - title: 'Charts', - icon: 'chart' - }, - children: [ - { - path: 'keyboard', - component: 'views/charts/keyboard', - name: 'KeyboardChart', - meta: { title: 'Keyboard Chart', noCache: true } - }, - { - path: 'line', - component: 'views/charts/line', - name: 'LineChart', - meta: { title: 'Line Chart', noCache: true } - }, - { - path: 'mixchart', - component: 'views/charts/mixChart', - name: 'MixChart', - meta: { title: 'Mix Chart', noCache: true } - } - ] - }, - { - path: '/nested', - component: 'layout/Layout', - redirect: '/nested/menu1/menu1-1', - name: 'Nested', - meta: { - title: 'Nested', - icon: 'nested' - }, - children: [ - { - path: 'menu1', - component: 'views/nested/menu1/index', - name: 'Menu1', - meta: { title: 'Menu1' }, - redirect: '/nested/menu1/menu1-1', - children: [ - { - path: 'menu1-1', - component: 'views/nested/menu1/menu1-1', - name: 'Menu1-1', - meta: { title: 'Menu1-1' } - }, - { - path: 'menu1-2', - component: 'views/nested/menu1/menu1-2', - name: 'Menu1-2', - redirect: '/nested/menu1/menu1-2/menu1-2-1', - meta: { title: 'Menu1-2' }, - children: [ - { - path: 'menu1-2-1', - component: 'views/nested/menu1/menu1-2/menu1-2-1', - name: 'Menu1-2-1', - meta: { title: 'Menu1-2-1' } - }, - { - path: 'menu1-2-2', - component: 'views/nested/menu1/menu1-2/menu1-2-2', - name: 'Menu1-2-2', - meta: { title: 'Menu1-2-2' } - } - ] - }, - { - path: 'menu1-3', - component: 'views/nested/menu1/menu1-3', - name: 'Menu1-3', - meta: { title: 'Menu1-3' } - } - ] - }, - { - path: 'menu2', - name: 'Menu2', - component: 'views/nested/menu2/index', - meta: { title: 'Menu2' } - } - ] - }, - - { - path: '/example', - component: 'layout/Layout', - redirect: '/example/list', - name: 'Example', - meta: { - title: 'Example', - icon: 'example' - }, - children: [ - { - path: 'create', - component: 'views/example/create', - name: 'CreateArticle', - meta: { title: 'Create Article', icon: 'edit' } - }, - { - path: 'edit/:id(\\d+)', - component: 'views/example/edit', - name: 'EditArticle', - meta: { title: 'Edit Article', noCache: true }, - hidden: true - }, - { - path: 'list', - component: 'views/example/list', - name: 'ArticleList', - meta: { title: 'Article List', icon: 'list' } - } - ] - }, - - { - path: '/tab', - component: 'layout/Layout', - children: [ - { - path: 'index', - component: 'views/tab/index', - name: 'Tab', - meta: { title: 'Tab', icon: 'tab' } - } - ] - }, - - { - path: '/error', - component: 'layout/Layout', - redirect: 'noRedirect', - name: 'ErrorPages', - meta: { - title: 'Error Pages', - icon: '404' - }, - children: [ - { - path: '401', - component: 'views/error-page/401', - name: 'Page401', - meta: { title: 'Page 401', noCache: true } - }, - { - path: '404', - component: 'views/error-page/404', - name: 'Page404', - meta: { title: 'Page 404', noCache: true } - } - ] - }, - - { - path: '/error-log', - component: 'layout/Layout', - redirect: 'noRedirect', - children: [ - { - path: 'log', - component: 'views/error-log/index', - name: 'ErrorLog', - meta: { title: 'Error Log', icon: 'bug' } - } - ] - }, - - { - path: '/excel', - component: 'layout/Layout', - redirect: '/excel/export-excel', - name: 'Excel', - meta: { - title: 'Excel', - icon: 'excel' - }, - children: [ - { - path: 'export-excel', - component: 'views/excel/export-excel', - name: 'ExportExcel', - meta: { title: 'Export Excel' } - }, - { - path: 'export-selected-excel', - component: 'views/excel/select-excel', - name: 'SelectExcel', - meta: { title: 'Select Excel' } - }, - { - path: 'export-merge-header', - component: 'views/excel/merge-header', - name: 'MergeHeader', - meta: { title: 'Merge Header' } - }, - { - path: 'upload-excel', - component: 'views/excel/upload-excel', - name: 'UploadExcel', - meta: { title: 'Upload Excel' } - } - ] - }, - - { - path: '/zip', - component: 'layout/Layout', - redirect: '/zip/download', - alwaysShow: true, - meta: { title: 'Zip', icon: 'zip' }, - children: [ - { - path: 'download', - component: 'views/zip/index', - name: 'ExportZip', - meta: { title: 'Export Zip' } - } - ] - }, - - { - path: '/pdf', - component: 'layout/Layout', - redirect: '/pdf/index', - children: [ - { - path: 'index', - component: 'views/pdf/index', - name: 'PDF', - meta: { title: 'PDF', icon: 'pdf' } - } - ] - }, - { - path: '/pdf/download', - component: 'views/pdf/download', - hidden: true - }, - - { - path: '/theme', - component: 'layout/Layout', - redirect: 'noRedirect', - children: [ - { - path: 'index', - component: 'views/theme/index', - name: 'Theme', - meta: { title: 'Theme', icon: 'theme' } - } - ] - }, - - { - path: '/clipboard', - component: 'layout/Layout', - redirect: 'noRedirect', - children: [ - { - path: 'index', - component: 'views/clipboard/index', - name: 'ClipboardDemo', - meta: { title: 'Clipboard Demo', icon: 'clipboard' } - } - ] - }, - - { - path: '/i18n', - component: 'layout/Layout', - children: [ - { - path: 'index', - component: 'views/i18n-demo/index', - name: 'I18n', - meta: { title: 'I18n', icon: 'international' } - } - ] - }, - - { - path: 'external-link', - component: 'layout/Layout', - children: [ - { - path: 'https://github.com/PanJiaChen/vue-element-admin', - meta: { title: 'External Link', icon: 'link' } - } - ] - }, - - { path: '*', redirect: '/404', hidden: true } -] - -module.exports = { - constantRoutes, - asyncRoutes -} diff --git a/PC/InterFace.Dash/mock/user.js b/PC/InterFace.Dash/mock/user.js deleted file mode 100644 index d82e079..0000000 --- a/PC/InterFace.Dash/mock/user.js +++ /dev/null @@ -1,84 +0,0 @@ - -const tokens = { - admin: { - token: 'admin-token' - }, - editor: { - token: 'editor-token' - } -} - -const users = { - 'admin-token': { - roles: ['admin'], - introduction: 'I am a super administrator', - avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', - name: 'Super Admin' - }, - 'editor-token': { - roles: ['editor'], - introduction: 'I am an editor', - avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', - name: 'Normal Editor' - } -} - -module.exports = [ - // user login - { - url: '/vue-element-admin/user/login', - type: 'post', - response: config => { - const { username } = config.body - const token = tokens[username] - - // mock error - if (!token) { - return { - code: 60204, - message: 'Account and password are incorrect.' - } - } - - return { - code: 20000, - data: token - } - } - }, - - // get user info - { - url: '/vue-element-admin/user/info\.*', - type: 'get', - response: config => { - const { token } = config.query - const info = users[token] - - // mock error - if (!info) { - return { - code: 50008, - message: 'Login failed, unable to get user details.' - } - } - - return { - code: 20000, - data: info - } - } - }, - - // user logout - { - url: '/vue-element-admin/user/logout', - type: 'post', - response: _ => { - return { - code: 20000, - data: 'success' - } - } - } -] diff --git a/PC/InterFace.Dash/mock/utils.js b/PC/InterFace.Dash/mock/utils.js deleted file mode 100644 index f909a29..0000000 --- a/PC/InterFace.Dash/mock/utils.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @param {string} url - * @returns {Object} - */ -function param2Obj(url) { - const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') - if (!search) { - return {} - } - const obj = {} - const searchArr = search.split('&') - searchArr.forEach(v => { - const index = v.indexOf('=') - if (index !== -1) { - const name = v.substring(0, index) - const val = v.substring(index + 1, v.length) - obj[name] = val - } - }) - return obj -} - -/** - * This is just a simple version of deep copy - * Has a lot of edge cases bug - * If you want to use a perfect deep copy, use lodash's _.cloneDeep - * @param {Object} source - * @returns {Object} - */ -function deepClone(source) { - if (!source && typeof source !== 'object') { - throw new Error('error arguments', 'deepClone') - } - const targetObj = source.constructor === Array ? [] : {} - Object.keys(source).forEach(keys => { - if (source[keys] && typeof source[keys] === 'object') { - targetObj[keys] = deepClone(source[keys]) - } else { - targetObj[keys] = source[keys] - } - }) - return targetObj -} - -module.exports = { - param2Obj, - deepClone -} diff --git a/PC/InterFace.Dash/public/config.js b/PC/InterFace.Dash/public/config.js index 379690e..92d0b1b 100644 --- a/PC/InterFace.Dash/public/config.js +++ b/PC/InterFace.Dash/public/config.js @@ -1,6 +1,7 @@ // dev_win -window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60068' -// window.SITE_CONFIG['base'] = 'http://192.168.0.180:60068' +window.SITE_CONFIG['baseApi'] = 'http://dev.ccwin-in.com:60068' +// window.SITE_CONFIG['baseApi'] = 'http://192.168.0.190:60068' +window.SITE_CONFIG['authApi'] = 'http://dev.ccwin-in.com:60068' window.SITE_CONFIG['businessApi'] = 'http://dev.ccwin-in.com:10097' window.SITE_CONFIG['columnsApiNamesZh'] = 'Z' window.SITE_CONFIG['isAutoLogin'] = true diff --git a/PC/InterFace.Dash/src/App.vue b/PC/InterFace.Dash/src/App.vue index 8547b75..3870738 100644 --- a/PC/InterFace.Dash/src/App.vue +++ b/PC/InterFace.Dash/src/App.vue @@ -8,7 +8,8 @@ export default { name: 'App' } -localStorage.setItem('base',window.SITE_CONFIG['base']) +localStorage.setItem('baseApi',window.SITE_CONFIG['baseApi']) +localStorage.setItem('authApi',window.SITE_CONFIG['authApi']) localStorage.setItem('businessApi',window.SITE_CONFIG['businessApi']) localStorage.setItem('columnsApiNamesZh',window.SITE_CONFIG['columnsApiNamesZh']) localStorage.setItem('isAutoLogin',window.SITE_CONFIG['isAutoLogin']) diff --git a/PC/InterFace.Dash/src/api/wms-api.js b/PC/InterFace.Dash/src/api/wms-api.js index 835bfb5..c97d890 100644 --- a/PC/InterFace.Dash/src/api/wms-api.js +++ b/PC/InterFace.Dash/src/api/wms-api.js @@ -1,8 +1,8 @@ import request from '@/utils/request' import store from '@/store' // let baseURL = process.env.VUE_APP_BASE_API + '/' -let baseURL = localStorage.getItem('base') + '/api/' -let printURL = localStorage.getItem('print') + '/api/' +let baseURL = localStorage.getItem('baseApi') + '/api/' + //新建 export function postCreate(data, url) { if (Object.keys(data).includes('company')) { @@ -30,22 +30,6 @@ export function postUpdate(data, id, url) { params:{id:id} }) } -//申请流程 -export function processRequest(id, url) { - return request({ - url: baseURL + url + id, - method: 'post', - }) -} -//子表编辑 -export function postDetailUpdate(data, id, UrlData, url) { - return request({ - url: baseURL + url + '/detail/' + id, - method: 'put', - params: UrlData, - data - }) -} //删除 export function postDelete(id, url) { return request({ @@ -55,14 +39,6 @@ export function postDelete(id, url) { params:{id:id} }) } -//子表删除 -// export function postDetailDelete(id, UrlData, url) { -// return request({ -// url: baseURL + url + '/detail/' + id, -// method: 'delete', -// params: UrlData -// }) -// } //分页+筛选【列表】 export function getPageList(data, url, includeDetails) { let _url = includeDetails ? baseURL + url + '/get-list-page-by-filter?includeDetails='+ includeDetails : baseURL + url + '/get-list-page-by-filter' @@ -72,7 +48,6 @@ export function getPageList(data, url, includeDetails) { data }) } - //分页+筛选【明细列表】 export function getPageListForDetail(data, url, includeDetails) { return request({ @@ -81,8 +56,6 @@ export function getPageListForDetail(data, url, includeDetails) { data }) } - - // 根据id获取主表信息 export function getListDesById(url,id) { return request({ @@ -90,7 +63,6 @@ export function getListDesById(url,id) { url: baseURL + url + '/' + id }) } - //导出-获取文件 blobName /** * @param {*} data @@ -132,14 +104,6 @@ export function fileStorage(data) { params: data, }) } -//导入-新-创建文件 -export function fileStorageCreate(data) { - return request({ - url: baseURL + 'filestore/file/create', - method: 'post', - data - }) -} //导入 isSpecial 是否为特殊接口 export function postImport(data, url,isSpecial) { let _url = isSpecial ? url : url + '/import' @@ -161,9 +125,6 @@ export function postImportDown(url) { responseType: 'blob' }) } - - -//---------------------------通用--------------------------- //获取详情 export function getDetailed(id, url) { return request({ @@ -171,8 +132,7 @@ export function getDetailed(id, url) { method: 'get', }) } -//---------------------------只查询------------------------- -//获取分页+筛选 +//获取分页+筛选(只查询) export function getPage(data, url) { return request({ url: baseURL + url, @@ -180,61 +140,6 @@ export function getPage(data, url) { params: data }) } -//打印标签 -export function PrintServices(data) { - return request({ - url: printURL + 'reporting/PrintServices', - method: 'post', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' - }, - transformRequest: [ - function (data) { - var ret = '' - for (var it in data) { - ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' - } - ret = ret.substring(0, ret.lastIndexOf('&')) - return ret - } - ], - data - }) -} - -//首页——获取当前用户未读消息 -export function userNotifyNotReadList(userId) { - return request({ - url: baseURL + 'message/user-notify-message/not-read-list/' + userId, - method: 'get' - }) -} - -//首页——获取当前用户已读消息 -export function userNotifyHasRead(userId) { - return request({ - url: baseURL + 'message/user-notify-message/has-read-list/' + userId, - method: 'get' - }) -} - -//首页——修改当前用户消息状态 -export function userNotifyMessageUpdate(id) { - return request({ - url: baseURL + 'message/user-notify-message/read/' + id, - method: 'post' - }) -} - -//首页——获取当前用户消息详情 -export function notifyMessage(params, id) { - return request({ - url: baseURL + 'message/notify-message/' + id, - method: 'get', - params: params, - }) -} - // 获取版本编号 export function getVsersion() { return request({ diff --git a/PC/InterFace.Dash/src/api/wms-auth.js b/PC/InterFace.Dash/src/api/wms-auth.js index 7f88b9e..c637c39 100644 --- a/PC/InterFace.Dash/src/api/wms-auth.js +++ b/PC/InterFace.Dash/src/api/wms-auth.js @@ -1,9 +1,9 @@ import request from '@/utils/request' -let baseURL = localStorage.getItem('base') + '/api' +let authApi = localStorage.getItem('authApi') + '/api' export function login(data) { return request({ - url: baseURL + '/account/login', + url: authApi + '/account/login', method: 'post', data }) @@ -11,268 +11,57 @@ export function login(data) { export function token(data) { return request({ - // url: baseURL + '/token', - url: baseURL + '/connect/token', + url: authApi + '/connect/token', method: 'post', data }) } -export function getInfo() { - return request({ - url: baseURL + '/abp/application-configuration', - method: 'get', - }) -} export function logout() { return request({ - url: baseURL + '/account/logout', + url: authApi + '/account/logout', method: 'get' }) } -//新建 -export function postCreate(data) { - return request({ - url: baseURL + '/identity/users', - method: 'post', - data - }) -} -//获取全部角色 | 用户信息维护 -export function usersroles() { - return request({ - url: baseURL + '/identity/users/assignable-roles', - method: 'get' - }) -} -//获取当前角色 | 用户信息维护 -export function getusersID(data) { - return request({ - url: baseURL + '/identity/users/' + data + '/roles', - method: 'get' - }) -} -//编辑 -export function postUpdate(data, id) { - return request({ - url: baseURL + '/identity/users/' + id, - method: 'put', - data - }) -} -//删除 -export function postDelete(id) { - return request({ - url: baseURL + '/identity/users/' + id, - method: 'delete', - }) -} -//分页+筛选 -export function getPageList(data) { - return request({ - url: baseURL + '/identity/users', - method: 'get', - params: data - }) -} -//重置密码功能 | 用户信息维护 -export function putpassword(id) { - return request({ - url: baseURL + '/identity/users/reset-password/' + id, - method: 'post' - }) -} -//获取全部权限(包含PDA+pc) | PC菜单信息维护 | PDA菜单信息维护 | PDA用户权限维护 | PC角色权限维护 -export function menuPermissions(data) { - return request({ - url: baseURL + '/auth/menu/list', - method: 'post', - data - }) -} -//新建菜单 | PC菜单信息维护 | PDA菜单信息维护 -export function postCreateMenu(data) { - return request({ - url: baseURL + '/auth/menu', - method: 'post', - data - }) -} -//编辑菜单 | PC菜单信息维护 | PDA菜单信息维护 -export function postUpdateMenu(data, id) { - return request({ - url: baseURL + '/auth/menu/' + id, - method: 'put', - data - }) -} -//删除菜单 | PC菜单信息维护 | PDA菜单信息维护 -export function postDeleteMenu(id) { - return request({ - url: baseURL + '/auth/menu/' + id, - method: 'delete', - }) -} -//获取菜单详情 | PC菜单信息维护 | PDA菜单信息维护 -export function getDetailedMenu(id) { - return request({ - url: baseURL + '/auth/menu/' + id, - method: 'get', - }) -} -//获取用户全部工作组 | 用户工作组对应关系 -// export function workgroupPermissions() { -// return request({ -// url: baseURL + '/auth/user-workgroup/get-list', -// method: 'get', -// params:{ -// SkipCount:0, -// MaxResultCount:100 -// } -// }) -// } -//获取已有权限 | PDA用户权限维护 -export function UserPermissions(id, url) { - return request({ - url: baseURL + '/' + url + '/' + id.userId, - method: 'get', - params:id - }) -} - -//保存权限 | PDA用户权限维护 -export function SetUserPermissions(data, id, url) { - return request({ - url: baseURL + '/' + url + '/' + id.userId, - method: 'put', - params:id, - data - }) -} - -//获取用户已有工作组 | 用户工作组对应关系 -export function userWorkgroupPermissions(id) { +// faster-new +// 通过用户名获取用户信息 +export function getUsersByUserName(name) { return request({ - url: baseURL + '/auth/user-workgroup/get-user-work-group-by-user-id', + url: authApi + '/identity/users/by-username/'+name, method: 'get', - params:id }) } -//保存用户与工作组关系 | 用户工作组对应关系 -export function SetUserWorkgroupPermissions(data,id) { - return request({ - url: baseURL + '/auth/user-workgroup/add-many', - method: 'post', - params:id, - data - }) -} -//加载用户登录信息 -export function loadLoginUserInfo(id) { - return request({ - url: baseURL + '/identity/users/' + id, - method: 'get' - }) -} -//修改登录用户基本信息 -export function putLoginUserInfo(data) { - return request({ - url: baseURL + '/identity/my-profile', - method: 'put', - data - }) -} -//修改登录用户的密码-强密码规则 -export function postLoginUserInfo(data, id) { - return request({ - url: baseURL + '/identity/users/change-password/' + id, - method: 'post', - data - }) -} - -//获取部门列表 | 用户信息维护 | 部门信息维护 -export function departmentList(data) { - return request({ - url: baseURL + '/auth/department/list', - method: 'post', - data - }) -} -//获取明细列表 -export function getDetailed(id, url) { +// 获取表头zh转义数据 +export function getInterfaceBoard() { return request({ - url: baseURL + url + id, - method: 'get' + method:'get', + url: authApi + '/abp/application-localization', + params:{ + CultureName:localStorage.getItem('browserLanguage'), + OnlyDynamics:false + } + // params:{IncludeLocalizationResources:true} }) } -//------------------------------------- -// 创建 | PC角色权限维护 -export function postCreateRoles(data) { - return request({ - url: baseURL + '/identity/roles', - method: 'post', - data - }) -} -//编辑 | PC角色权限维护 -export function postUpdateRoles(data, id) { +// 获取菜单数据 +export function getDefinitionMenu(IncludeTypes) { return request({ - url: baseURL+'/identity/roles/' + id, - method: 'put', - data - }) -} -//删除 | PC角色权限维护 -export function postDeleteRoles(id) { - return request({ - url: baseURL + '/identity/roles/' + id, - method: 'delete', - }) -} -// 描述修改 | PC角色权限维护 -export function saveOrUpdateDescribe(params,id) { - return request({ - url: baseURL + '/identity/roles/' + id + '/description', - method: 'post', - params: params - }) -} -//分页+筛选 | PC角色权限维护 -export function getPageListRoles(data) { - return request({ - url: baseURL + '/identity/roles', - method: 'get', - params: data + method:'get', + url: authApi + '/abp/application-configuration', + params:{IncludeLocalizationResources:true} }) } -//获取权限模板 | PC角色权限维护 -export function getpermissionsRoles(data) { - return request({ - url: baseURL +'/permission-management/permissions', - method: 'get', - params: data - }) -} -//保存权限模板 | PC角色权限维护 -export function putpermissionsRoles(url, data) { +// 获取枚举数据/dto列类型等所有配置 +export async function getApiDefinition() { return request({ - url: baseURL+ url, - method: 'put', - data + method:'get', + url: authApi + '/abp/api-definition', + params:{IncludeTypes:true} }) } - -// faster-new -export function getUsersByUserName(name) { - return request({ - url: baseURL + '/identity/users/by-username/'+name, - method: 'get', - }) -} \ No newline at end of file diff --git a/PC/InterFace.Dash/src/api/wms-business.js b/PC/InterFace.Dash/src/api/wms-business.js index 9936ee9..65112a9 100644 --- a/PC/InterFace.Dash/src/api/wms-business.js +++ b/PC/InterFace.Dash/src/api/wms-business.js @@ -18,22 +18,4 @@ export function resetHandle(params,data,url) { params:params, data }) -} - -// // 测试数据-明细-列表 -// export function TestSchoolDetailList(data,includeDetails) { -// return request({ -// method:'post', -// url: base_api + '/api/TestStudentDetail/base/get-list-page-by-filter?includeDetails='+Boolean(includeDetails), -// data -// }) -// } - -// // 测试数据-明细-删除 -// export function TestSchoolDetailList_delete(id) { -// return request({ -// method:'DELETE', -// url: base_api + '/api/TestStudentDetail/base/delete-by-id', -// params:{id:id} -// }) -// } \ No newline at end of file +} \ No newline at end of file diff --git a/PC/InterFace.Dash/src/api/wms-interface.js b/PC/InterFace.Dash/src/api/wms-interface.js deleted file mode 100644 index 35e863e..0000000 --- a/PC/InterFace.Dash/src/api/wms-interface.js +++ /dev/null @@ -1,34 +0,0 @@ -// 接口监控看板相关api -import request from '@/utils/request' -let base_api = localStorage.getItem('base') - -// 获取表头zh转义数据 -export function getInterfaceBoard() { - return request({ - method:'get', - url: base_api + '/api/abp/application-localization', - params:{ - CultureName:localStorage.getItem('browserLanguage'), - OnlyDynamics:false - } - // params:{IncludeLocalizationResources:true} - }) -} - -// 获取菜单数据 -export function getDefinitionMenu(IncludeTypes) { - return request({ - method:'get', - url: base_api + '/api/abp/application-configuration', - params:{IncludeLocalizationResources:true} - }) -} - -// 获取枚举数据/dto列类型等所有配置 -export async function getApiDefinition() { - return request({ - method:'get', - url: base_api + '/api/abp/api-definition', - params:{IncludeTypes:true} - }) -} diff --git a/PC/InterFace.Dash/src/api/wms-job.js b/PC/InterFace.Dash/src/api/wms-job.js deleted file mode 100644 index 0f5407a..0000000 --- a/PC/InterFace.Dash/src/api/wms-job.js +++ /dev/null @@ -1,49 +0,0 @@ -import request from '@/utils/request' -// let baseURL = process.env.VUE_APP_BASE_API + '/' -let baseURL = localStorage.getItem('base') + '/api/' - -//---------------------------通用--------------------------- -//任务流程——承接 -export function accept(url, data) { - return request({ - url: baseURL + url + '/accept/'+data.id, - method: 'post', - // params: data - }) -} - -//任务流程——关闭 -export function close(url, data) { - return request({ - url: baseURL + url + '/close/'+data.id, - method: 'post', - // params: data - }) -} - -//任务流程——取消 -export function cancel(url, data) { - return request({ - url: baseURL + url + '/cancel/'+data.id, - method: 'post', - // params: data - }) -} - -//任务流程——取消承接 | 采购收货任务 -export function cancelAccept(url, data) { - return request({ - url: baseURL + url + '/cancel-accept/'+data.id, - method: 'post', - // params: data - }) -} - -//任务流程——打开 -export function open(url, data) { - return request({ - url: baseURL + url + '/open/'+data.id, - method: 'post', - // params: data - }) -} \ No newline at end of file diff --git a/PC/InterFace.Dash/src/components/News/dialogIndex.vue b/PC/InterFace.Dash/src/components/News/dialogIndex.vue deleted file mode 100644 index 7259be1..0000000 --- a/PC/InterFace.Dash/src/components/News/dialogIndex.vue +++ /dev/null @@ -1,337 +0,0 @@ - - -用户名
-{{ user.userName }}
-姓名
-{{ user.name }}
-