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 }*/ return { code: 0, message: '', data: { token: '0ac9709d32945302ef5ce62d8a5a0324' }} } }, // 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 }*/ return { code: 0, message: 'ok', data: { user_name: 'youwl', nick_name: '游1', avatar: 'http:\/\/oss.bbshenqian.cn\/bbshenqian\/common\/2020\/0215\/logo.png', phone: '13555555555', is_super: 0, update_time: '2020-12-15T02:31:48.000000Z', create_time: '2016-05-11T11:06:16.000000Z' }} } }, // user logout { url: '/vue-element-admin/user/logout', type: 'post', response: _ => { return { code: 0, data: 'success' } } }, // getAdminList { url: '/vue-element-admin/user/get-admin-list', type: 'get', response: _ => { return { code: 0, message: 'ok', data: { current_page: 1, data: [ { id: 1, company_id: 3, user_id: 3, user_name: '游文亮', nick_name: '游文亮', real_name: '游文亮', role_name: '角色', role_id: 2, phone: '13777777777', create_time: '2020-12-08 11:18:50', update_time: '2020-12-08 11:18:50' }, { id: 2, company_id: 3, user_id: 3, user_name: '游文亮1', nick_name: '游文亮1', real_name: '游文亮1', role_name: '角色1', role_id: 1, phone: '13777777777', create_time: '2020-12-08 11:18:50', update_time: '2020-12-08 11:18:50' }, { id: 3, company_id: 3, user_id: 3, user_name: '游文亮2', nick_name: '游文亮3', real_name: '游文亮3', role_name: '角色3', role_id: 3, phone: '13777777777', create_time: '2020-12-08 11:18:50', update_time: '2020-12-08 11:18:50' } ], from: 1, last_page: 1, per_page: '10', to: 8, total: 12 } } } }, // role-lest { url: '/vue-element-admin/user/role-lest', type: 'get', response: _ => { return { code: 0, message: 'ok', data: { current_page: 1, data: [ { id: 1, role_name: '管理猿', create_time: '2016-05-11 03:06:16', status: 0 }, { id: 2, role_name: '运营猿', create_time: '2016-05-11 03:06:16', status: 0 }, { id: 3, role_name: '低级管理猿', create_time: '2016-05-11 03:06:16', status: 0 } ], from: 0, last_page: 1, per_page: 10, to: 3, total: 3 } } } }, // 公司账号列表 { url: '/vue-element-admin/user/get-company-list', type: 'get', response: _ => { return { 'code': 0, 'message': 'ok', 'data': { 'current_page': 1, 'data': [ { 'id': 10313, 'name': '游文亮', 'phone': '', 'address': '', 'update_time': '2016-03-15 10:45:52', 'create_time': '2016-03-15 10:40:37', 'status': '0', 'active_time': '2016-03-15 00:00:00', 'invalid_time': '2020-12-23 00:00:00', 'type_id': 1, 'bind_app': '[{"id":"4","vers":["8"]},{"id":"6","vers":["11","13","14","19"]},{"id":"9","vers":["15"]},{"id":"27","vers":["18"]}]', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 10, 'website_count': '50' }, { 'id': 10314, 'name': '厦门聚百客科技有限公司', 'phone': '', 'address': '', 'update_time': '2020-04-05 12:16:49', 'create_time': '2020-03-10 03:39:15', 'status': '0', 'active_time': '2020-02-01 00:00:00', 'invalid_time': '2029-12-31 00:00:00', 'type_id': 0, 'bind_app': '[{"id":"4","vers":["8"]},{"id":"6","vers":["11","13","14","19"]},{"id":"9","vers":["15"]},{"id":"27","vers":["18"]}]', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '50' }, { 'id': 10315, 'name': '科勒尔', 'phone': '', 'address': '', 'update_time': '2020-04-05 12:16:28', 'create_time': '2020-03-30 05:45:08', 'status': '0', 'active_time': '2020-03-30 00:00:00', 'invalid_time': '2021-12-31 00:00:00', 'type_id': 0, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '7' }, { 'id': 10316, 'name': 'CBME童装展-新英富曼集团', 'phone': '', 'address': '', 'update_time': '2020-04-05 12:02:21', 'create_time': '2020-04-05 12:02:21', 'status': '0', 'active_time': '2020-04-05 00:00:00', 'invalid_time': '2021-12-31 00:00:00', 'type_id': 0, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '1' }, { 'id': 10317, 'name': '东网电力', 'phone': '', 'address': '', 'update_time': '2020-04-05 12:06:37', 'create_time': '2020-04-05 12:06:37', 'status': '0', 'active_time': '2020-04-05 00:00:00', 'invalid_time': '2021-12-31 00:00:00', 'type_id': 0, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '4' }, { 'id': 10318, 'name': '悦容整形', 'phone': '', 'address': '', 'update_time': '2020-04-05 12:09:44', 'create_time': '2020-04-05 12:09:44', 'status': '0', 'active_time': '2020-04-05 00:00:00', 'invalid_time': '2021-12-01 00:00:00', 'type_id': 0, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '3' }, { 'id': 10319, 'name': 'china-homecare', 'phone': '', 'address': '', 'update_time': '2020-04-15 02:10:21', 'create_time': '2020-04-15 02:09:01', 'status': '0', 'active_time': '0000-11-30 00:00:00', 'invalid_time': '2021-04-15 00:00:00', 'type_id': 0, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '13', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '2' }, { 'id': 10320, 'name': '翡翠侠', 'phone': '', 'address': '', 'update_time': '2020-04-28 14:28:06', 'create_time': '2020-04-28 14:28:06', 'status': '0', 'active_time': '2020-04-28 00:00:00', 'invalid_time': '2021-12-31 00:00:00', 'type_id': 0, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 1, 'website_count': '1' }, { 'id': 10323, 'name': '苏凯欣', 'phone': '', 'address': '', 'update_time': '2020-06-24 01:36:54', 'create_time': '2020-06-24 01:36:54', 'status': '0', 'active_time': '2020-06-23 00:00:00', 'invalid_time': '2022-04-01 00:00:00', 'type_id': 1, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '50' }, { 'id': 10325, 'name': 'standard ME', 'phone': '', 'address': '', 'update_time': '2020-09-01 07:41:16', 'create_time': '2020-09-01 07:41:16', 'status': '0', 'active_time': '2020-09-01 00:00:00', 'invalid_time': '2029-12-31 00:00:00', 'type_id': 1, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '', 'city': '', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': '50' } ], 'from': 0, 'last_page': 2, 'per_page': 10, 'to': 10, 'total': 15 } } } }, // 省份列表 { url: '/vue-element-admin/user/get-province-list', type: 'get', response: _ => { return { 'code': 0, 'message': 'ok', 'data': [ { 'id': 1, 'province': '直辖市' }, { 'id': 2, 'province': '河北省' }, { 'id': 3, 'province': '江西省' }, { 'id': 4, 'province': '山东省' }, { 'id': 5, 'province': '山西省' }, { 'id': 6, 'province': '内蒙古自治区' }, { 'id': 7, 'province': '河南省' }, { 'id': 8, 'province': '辽宁省' }, { 'id': 9, 'province': '湖北省' }, { 'id': 10, 'province': '吉林省' }, { 'id': 11, 'province': '湖南省' }, { 'id': 12, 'province': '黑龙江' }, { 'id': 13, 'province': '广东省' }, { 'id': 14, 'province': '江苏省' }, { 'id': 15, 'province': '广西壮族自治区' }, { 'id': 16, 'province': '海南省' }, { 'id': 17, 'province': '四川省' }, { 'id': 18, 'province': '浙江省' }, { 'id': 19, 'province': '贵州省' }, { 'id': 20, 'province': '安徽省' }, { 'id': 21, 'province': '云南省' }, { 'id': 22, 'province': '福建省' }, { 'id': 23, 'province': '澳门特别行政区' }, { 'id': 24, 'province': '甘肃省' }, { 'id': 25, 'province': '黑龙江省' }, { 'id': 26, 'province': '宁夏回族自治区' }, { 'id': 27, 'province': '青海省' }, { 'id': 28, 'province': '陕西省' }, { 'id': 29, 'province': '台湾省' }, { 'id': 30, 'province': '西藏自治区' }, { 'id': 31, 'province': '香港特别行政区' }, { 'id': 32, 'province': '新疆维吾尔自治区' }, { 'id': 33, 'province': 'asdfasd' }, { 'id': 34, 'province': '加利福尼亚州' }, { 'id': 35, 'province': 'abcdefg' }, { 'id': 36, 'province': '新泽西州' } ] } } }, // 城市列表 { url: '/vue-element-admin/user/get-city-list', type: 'get', response: _ => { return { 'code': 0, 'message': 'ok', 'data|5': [ { 'id|+1': 1, 'province_id|+1': 2, 'city|1': ['张家口市', '沧州市', '承德市', '邯郸市', '衡水市', '廊坊市'], 'area_code|+1': '0313', 'province': '河北省' } ] } } }, // 公司详情 { url: '/vue-element-admin/user/get-company', type: 'get', response: _ => { return { 'code': 0, 'message': 'ok', 'data': { 'id': 10333, 'name': 'jy', 'phone': '13311111111', 'address': '厦门市思明区xxxxxxx', 'update_time': '2020-12-22 09:17:27', 'create_time': '2020-12-22 07:57:23', 'status': 0, 'active_time': '2016-03-15 00:00:00', 'invalid_time': '2020-12-23 00:00:00', 'type_id': 1, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': 22, 'city': 1, 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': null } } } }, // 公司授权应用详情 { url: '/vue-element-admin/user/get-user-soft-bind', type: 'get', response: _ => { return { 'code': 0, 'message': 'ok', 'data': { 'id': 10333, 'name': '李肖明2', 'phone': '13311111111', 'address': '集美区', 'update_time': '2020-12-22 09:42:44', 'create_time': '2020-12-22 07:57:23', 'status': 1, 'active_time': '2016-03-15 00:00:00', 'invalid_time': '2020-12-23 00:00:00', 'type_id': 1, 'bind_app': '', 'agent_id': 1, 'is_login_code': 0, 'login_code_mobile': '', 'province': '22', 'city': '261', 'domain': '', 'user_type_id': 0, 'sub_user_count': 5, 'website_count': null, 'bind_apps': [ { 'id': 5942, 'bind_user': 10333, 'app_id': 1, 'ver_id': 32, 'ver_func': '', 'start_time': '2016-03-15 09:42:44', 'end_time': '2020-12-23 09:42:44', 'status': 0, 'create_time': '2020-12-23 06:07:40', 'update_time': '2020-12-23 07:12:20' }, { 'id': 5945, 'bind_user': 10333, 'app_id': 2, 'ver_id': 33, 'ver_func': [93, 96], 'start_time': '2016-03-15 09:42:44', 'end_time': '2020-12-28 09:42:44', 'status': 0, 'create_time': '2020-12-23 06:35:33', 'update_time': '2020-12-23 07:12:20' } ] } } } }, // 获取公司应用管理菜单\功能权限列表详情 { url: '/vue-element-admin/user/get-app-menus-list', type: 'get', response: _ => { return { 'code': 0, 'message': 'ok', 'data': { 'current_page': 1, 'data': [ { 'id': 1, 'menus_name': '展会管理', 'sort': 1, 'role_name': '', 'role_key': '', 'pid': 0, 'icon': '', 'app_id': 1, 'is_default': 0, 'status': 0, 'update_time': '2019-08-24 11:24:39', 'create_time': null, 'name': '展会系统', 'p_name': '' }, { 'id': 2, 'menus_name': '创建展会', 'sort': 1, 'role_name': 'MNU-SYS-EXHIBITION', 'role_key': 'Account.Index.index', 'pid': 1, 'icon': 'fa fa-slideshare', 'app_id': 1, 'is_default': 0, 'status': 0, 'update_time': '2019-08-24 11:18:00', 'create_time': null, 'name': '展会系统', 'p_name': '展会管理' }, { 'id': 3, 'menus_name': '测试菜单', 'sort': 0, 'role_name': 'cs', 'role_key': 'Account.Index.cs', 'pid': 2, 'icon': '', 'app_id': 1, 'is_default': 0, 'status': 0, 'update_time': '2020-12-15 10:34:01', 'create_time': null, 'name': '展会系统', 'p_name': '创建展会' }, { 'id': 4, 'menus_name': '页面', 'sort': 0, 'role_name': 'Page', 'role_key': 'page', 'pid': 0, 'icon': 'fa fa-slideshare', 'app_id': 1, 'is_default': 0, 'status': 0, 'update_time': '2020-12-18 09:53:45', 'create_time': null, 'name': '展会系统', 'p_name': '' }, { 'id': 5, 'menus_name': '页面', 'sort': 1, 'role_name': 'PageIdex', 'role_key': 'page.pageindex', 'pid': 4, 'icon': '', 'app_id': 1, 'is_default': 0, 'status': 0, 'update_time': '2020-12-18 09:53:54', 'create_time': null, 'name': '展会系统', 'p_name': '页面' } ], 'from': 0, 'last_page': 1, 'per_page': 10, 'to': 5, 'total': 5 } } } }, // 新增公司 { url: '/vue-element-admin/user/add-company', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } }, // 修改公司状态 { url: '/vue-element-admin/user/ban-company', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } }, // 公司授权应用提交 { url: '/vue-element-admin/user/save-user-soft-bind', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } }, // 新增后台账号 { url: '/vue-element-admin/user/add-admin-user', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } }, // 编辑后台账号 { url: '/vue-element-admin/user/edit-admin-user', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } }, // 修改后台账号状态 { url: '/vue-element-admin/user/ban-admin-userr', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } }, // 修改角色状态 { url: '/vue-element-admin/user/add-role', type: 'post', response: config => { return { 'code': 0, 'message': 'ok', 'data': 10333 } } } ]