123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- import Mock from 'mockjs'
- var dataList = []
- for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
- dataList.push(Mock.mock({
- 'userId': '@increment',
- 'username': '@name',
- 'email': '@email',
- 'mobile': /^1[0-9]{10}$/,
- 'status': 1,
- 'roleIdList': null,
- 'createUserId': 1,
- 'createTime': 'datetime'
- }))
- }
- export function list () {
- return {
-
- url: '/sys/user/list',
- type: 'get',
- data: {
- 'msg': 'success',
- 'code': 0,
- 'page': {
- 'totalCount': dataList.length,
- 'pageSize': 10,
- 'totalPage': 1,
- 'currPage': 1,
- 'list': dataList
- }
- }
- }
- }
- export function info () {
- return {
-
- url: '/sys/user/info',
- type: 'get',
- data: {
- 'msg': 'success',
- 'code': 0,
- 'user': dataList[0]
- }
- }
- }
- export function updatePassword () {
- return {
-
- url: '/sys/user/password',
- type: 'post',
- data: {
- 'msg': 'success',
- 'code': 0
- }
- }
- }
- export function add () {
- return {
-
- url: '/sys/user/save',
- type: 'post',
- data: {
- 'msg': 'success',
- 'code': 0
- }
- }
- }
- export function update () {
- return {
-
- url: '/sys/user/update',
- type: 'post',
- data: {
- 'msg': 'success',
- 'code': 0
- }
- }
- }
- export function del () {
- return {
-
- url: '/sys/user/delete',
- type: 'post',
- data: {
- 'msg': 'success',
- 'code': 0
- }
- }
- }
|