| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- 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 = [
- // sms code
- {
- url: '/v1/tel/code',
- type: 'get',
- response: config => {
- return {
- code: 200,
- status: true,
- data: [],
- message: '成功~'
- }
- }
- },
- // user login
- {
- url: '/v1/user/login',
- type: 'post',
- response: config => {
- return {
- code: 200,
- status: true,
- data: { data: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJMYXJhdmVsIiwibGF0IjoxNjM2Nzg1NTQ4LCJleHAiOjE2Mzc2NDk1NDgsInN1YiI6IjE3NzE5MTE4NzYzIiwiZGF0YSI6eyJ1c2VyX2lkIjoxNzEwLCJ1c2VyX3Bob25lIjoiMTc3MTkxMTg3NjMiLCJ1c2VyX3JlYWxuYW1lIjoiXHU5YWQ4XHU2NWIwXHU2NjBlIiwic3RhdHVzIjoyLCJsb2dpbmlwIjoiMTE1LjE5My4xMzcuMTQ4IiwibG9naW50aW1lIjoiMjAxOS0xMS0wNSAxNzo1ODo0NSIsInVwZGF0ZWRfYXQiOiIxNjM2NzgzNDY4IiwibGV2ZWxfaWQiOjQsImF1dGhfZmFjZSI6MSwicHJvamVjdCI6Inl4OV9mcm9udCJ9fQ.EWXtDqo1tURytZUe8VzIK-Gdhu8mu2Uwt7GCZt6ipqM' },
- message: '成功'
- }
- }
- },
- // get user info
- {
- url: '/v1/personal/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: 200,
- status: true,
- message: '成功',
- data: {
- roles: ['admin'],
- introduction: 'I am a super administrator',
- avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
- name: '高新明',
- data: {
- 'user_id': 1710,
- 'user_phone': '17719118763',
- 'user_realname': '高新明',
- 'chennal': '游戏久 1446',
- 'user_money': '2113.78863',
- 'dongjie': '2000.00000',
- 'shangwubi': '681.29130',
- 'user_IDCard': '7897897899896',
- 'icon': '20200518614516391710.jpg',
- 'user_address': '北京*北京市*东城区*卡视角',
- 'user_email': '2281216777@qq.com',
- 'bankid': null,
- 'alipay': '17719118763',
- 'weixin': '',
- 'qq': '2281216777',
- 'status': 2,
- 'auth_face': 1,
- 'error': null,
- 'shangwu_rabc': 2,
- 'level_id': 4,
- 'company': '❤心新科技',
- 'logintime': '2019-11-05 17:58:45',
- 'last_loginip': '115.193.137.148',
- 'loginip': '115.193.137.148',
- 'user_IDCard_qy': '913601006859508926',
- 'user_realname_qy': '高新明',
- 'user_email_qy': '2281216777@qq.com',
- 'bankid_qy': '621799281010672917',
- 'user_address_qy': '河南省*周口市*项城市*6988989899688966',
- 'qq_qy': '21611226688',
- 'user_id_1_qy': '20200518268755971710.jpg',
- 'user_id_2_qy': '20200518541747191710.jpg',
- 'is_show_app': 1,
- 'is_make_app': 1,
- 'star_level': 1,
- 'star_amount': 36,
- 'star_name': '白银会员',
- 'star_free_cash': 0,
- 'use_free_cash': -100,
- 'cur_star_level': 2,
- 'cur_star_amount': 100042,
- 'cur_star_name': '黄金会员',
- 'shouyibao': 507.89,
- 'box_show': 1,
- 'level_value': 'A'
- }
- }
- }
- }
- },
- // 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: 200,
- data: token,
- message: '成功'
- }
- }
- },
- // user logout
- {
- url: '/vue-element-admin/user/logout',
- type: 'post',
- response: _ => {
- return {
- code: 200,
- data: 'success',
- message: '成功'
- }
- }
- }
- ]
|