|
@@ -151,7 +151,7 @@ export default {
|
|
|
url: '/login',
|
|
|
method: 'post',
|
|
|
data: this.loginForm
|
|
|
- }).then(res => {
|
|
|
+ }).then(async res => {
|
|
|
// console.log(res.data.token);
|
|
|
// localStorage.setItem('companyName', this.company_name);
|
|
|
if (res.data.code === 500){
|
|
@@ -160,12 +160,20 @@ export default {
|
|
|
}else {
|
|
|
Cookies.set("username",this.loginForm.username);
|
|
|
Cookies.set('TokenKey', res.data.token)
|
|
|
- if (this.fromPath === '/stock') {
|
|
|
- this.$router.push({ path: this.redirect || '/stock' });
|
|
|
- } else {
|
|
|
- this.$router.push({ path: this.redirect || '/' });
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
+
|
|
|
+ request({
|
|
|
+ url: '/system/user/profile',
|
|
|
+ method: 'get',
|
|
|
+ }).then(response => {
|
|
|
+ console.log(response)
|
|
|
+ Cookies.set("phone", encrypt(response.data.data.phonenumber), { expires: 30 })
|
|
|
+ if (this.fromPath === '/stock') {
|
|
|
+ this.$router.push({ path: this.redirect || '/stock' });
|
|
|
+ } else {
|
|
|
+ this.$router.push({ path: this.redirect || '/' });
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
console.log(err);
|