| | |
| | | import common from '@/static/js/common.js' |
| | | |
| | | async function getDetail() { |
| | | let _this = this,item = []; |
| | | let ress = await uni.request({ |
| | | url: `${common.baseUrl}/user/detail/auth`, |
| | | header:{'token':uni.getStorageSync('token')}, |
| | | }).then((res)=> { |
| | | res = res[1].data |
| | | // console.log(res); |
| | | if (res.code === 200) { |
| | | item = { |
| | | code: res.code, |
| | | data: res.data |
| | | } |
| | | } else if(res.code === 403){ |
| | | item = {code: 403,msg: '请重新登录'} |
| | | } |
| | | },(result)=>{ |
| | | // console.log(res); |
| | | }) |
| | | return item |
| | | } |
| | | |
| | | async function getUserTree() { |
| | | let _this = this,item = []; |
| | | let ress = await uni.request({ |
| | | url: `${common.baseUrl}/dept/user/tree/auth`, |
| | | header:{'token':uni.getStorageSync('token')}, |
| | | method: 'POST' |
| | | }).then((res)=> { |
| | | res = res[1].data |
| | | // console.log(res.data[0].children); |
| | | if (res.code === 200) { |
| | | item = { |
| | | code: res.code, |
| | | data: res.data[0].children |
| | | } |
| | | } else if(res.code === 403){ |
| | | item = {code: 403,msg: '请重新登录'} |
| | | } |
| | | },(result)=>{ |
| | | // console.log(res); |
| | | }) |
| | | return item |
| | | } |
| | | |
| | | module.exports = { |
| | | getDetail, |
| | | getUserTree |
| | | } |