diff --git a/.env.development b/.env.development index 8f5856d..6e7b816 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ ENV = 'development' # base api VUE_APP_BASE_API = '/dev-api' - +# VUE_APP_BASE_API = 'http://localhost/sys-glass/api/' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. # It only does one thing by converting all import() to require(). diff --git a/mock/table.js b/mock/table.js index ba95f76..b36449b 100644 --- a/mock/table.js +++ b/mock/table.js @@ -1,11 +1,11 @@ import Mock from 'mockjs' const data = Mock.mock({ - 'items|30': [{ + 'items|10': [{ id: '@id', - title: '@sentence(10, 20)', + title: '@sentence(3, 10)', 'status|1': ['published', 'draft', 'deleted'], - author: 'name', + author: 'name@integer(300, 5000)', display_time: '@datetime', pageviews: '@integer(300, 5000)' }] @@ -13,7 +13,7 @@ const data = Mock.mock({ export default [ { - url: '/vue-admin-template/table/list', + url: '/yp/table/list', type: 'get', response: config => { const items = data.items diff --git a/mock/user.js b/mock/user.js index f007cd9..4893ae1 100644 --- a/mock/user.js +++ b/mock/user.js @@ -3,35 +3,52 @@ const tokens = { admin: { token: 'admin-token' }, + assistant: { + token: 'assistant-token' + }, editor: { token: 'editor-token' + }, + shoper: { + token: 'shoper-token' } } const users = { - 'admin-token': { + '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': { + 'assistant-token': {//管理员助理 + roles: ['assistant'], + introduction: 'I am a assistant of 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' + }, + 'shoper-token': {//供应商 + roles: ['shoper'], + introduction: 'I am an shoper', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Normal Editor' } } export default [ // user login { - url: '/vue-admin-template/user/login', + url: '/yp/user/login', type: 'post', response: config => { const { username } = config.body const token = tokens[username] - // mock error if (!token) { return { @@ -49,7 +66,7 @@ export default [ // get user info { - url: '/vue-admin-template/user/info\.*', + url: '/yp/user/info\.*', type: 'get', response: config => { const { token } = config.query @@ -72,7 +89,7 @@ export default [ // user logout { - url: '/vue-admin-template/user/logout', + url: '/yp/user/logout', type: 'post', response: _ => { return { diff --git a/src/App.vue b/src/App.vue index c38fbaa..ac9c633 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
- +