Commit bc2adf38 authored by bobo826's avatar bobo826

feat: 代码优化

parent 284b8eae
...@@ -4,7 +4,7 @@ const resolve = (dir) => { ...@@ -4,7 +4,7 @@ const resolve = (dir) => {
return path.join(__dirname, '..', dir) return path.join(__dirname, '..', dir)
} }
const proxyUrl = 'http://192.168.32.30:3000' const proxyUrl = 'http://192.168.32.58:3000'
const agentList = { const agentList = {
'/': { '/': {
......
...@@ -24,15 +24,33 @@ export default { ...@@ -24,15 +24,33 @@ export default {
GkHeader GkHeader
}, },
mounted() { mounted() {
login('huanglu', '123').then((res) => {
console.log(res); userinfo({ token: '2424' }).then((res) => {
})
userinfo({ id: '2424' }).then((res) => {
console.log('userinfo ----> ', res); console.log('userinfo ----> ', res);
}) })
}, },
methods: { methods: {
...mapMutations(['changeName']), ...mapMutations(['changeName']),
loginfunc: () => {
login('18144260869', '88888888').then((res) => {
console.log(res);
// if (res.code === 0) {
// return true
// } else {
// return false
// }
}).catch((err) => {
console.log(err);
return false
})
},
userinfofunc: () => {
userinfo({ token: '2424' }).then((res) => {
console.log('userinfo ----> ', res);
}).catch(() => {
})
}
} }
} }
</script> </script>
......
import { get, post } from '@/utils/request'; import { get, post } from '@/utils/request';
export const login = (username, password) => post('/login', { username, password }); export const login = (account, password) => post('/service-user/auth/employee', {
account,
password,
assistant: false,
identityType: 1,
ip: '0.0.0.0',
type: 'employee'
});
export const userinfo = (params) => get('/userinfo', params); export const userinfo = (params) => get('/service-user/employees/info', params);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment