Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
founder_vue
Commits
2c8e5fea
Commit
2c8e5fea
authored
Oct 18, 2021
by
maxiaohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录接口调整
parent
1bd74a6e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
5 deletions
+43
-5
src/store/modules/user.js
+1
-0
src/views/Home/Home.vue
+19
-1
src/views/login/modules/AccountsLogin.vue
+15
-4
vue.config.js
+8
-0
No files found.
src/store/modules/user.js
View file @
2c8e5fea
...
@@ -16,6 +16,7 @@ const state = {
...
@@ -16,6 +16,7 @@ const state = {
const
mutations
=
{
const
mutations
=
{
SET_TOKEN
:
(
state
,
token
)
=>
{
SET_TOKEN
:
(
state
,
token
)
=>
{
state
.
token
=
token
;
state
.
token
=
token
;
console
.
log
(
state
.
token
);
},
},
SET_Logs
:
(
state
,
content
)
=>
{
SET_Logs
:
(
state
,
content
)
=>
{
state
.
logs
.
push
(
content
);
state
.
logs
.
push
(
content
);
...
...
src/views/Home/Home.vue
View file @
2c8e5fea
...
@@ -23,7 +23,9 @@
...
@@ -23,7 +23,9 @@
</ul>
</ul>
</div>
</div>
</div>
</div>
<div><img
src=
"../../assets/img/Home/exit.svg"
alt=
""
/>
安全退出
</div>
<div
style=
"border: #f6a51a 1px solid"
@
click=
"logout"
>
<img
src=
"../../assets/img/Home/exit.svg"
alt=
""
/>
安全退出
</div>
</div>
</div>
</div>
</div>
<!-- 主体 -->
<!-- 主体 -->
...
@@ -95,8 +97,15 @@
...
@@ -95,8 +97,15 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
qs
from
"qs"
;
export
default
{
export
default
{
name
:
"Home"
,
name
:
"Home"
,
data
()
{
return
{
userInfo
:
{
userName
:
"admin"
,
passWord
:
"123456"
}
};
},
methods
:
{
methods
:
{
gobdrd
()
{
gobdrd
()
{
this
.
$router
.
push
(
"/cxyrd"
);
this
.
$router
.
push
(
"/cxyrd"
);
...
@@ -106,6 +115,15 @@ export default {
...
@@ -106,6 +115,15 @@ export default {
},
},
gozzwcj
()
{
gozzwcj
()
{
this
.
$router
.
push
(
"/AllPersonnelBaseIndex"
);
this
.
$router
.
push
(
"/AllPersonnelBaseIndex"
);
},
logout
()
{
this
.
$axios
.
post
(
"/login/userLogout?"
).
then
(
res
=>
{
console
.
info
(
res
);
if
(
res
.
data
.
code
===
"200"
)
{
this
.
$message
.
success
(
"退出成功!"
);
this
.
$router
.
push
(
"/Login1"
);
}
});
}
}
}
}
};
};
...
...
src/views/login/modules/AccountsLogin.vue
View file @
2c8e5fea
...
@@ -67,6 +67,7 @@ export default {
...
@@ -67,6 +67,7 @@ export default {
methods
:
{
methods
:
{
// 登录
// 登录
login
(
userinfo
)
{
login
(
userinfo
)
{
let
me
=
this
;
console
.
info
(
this
.
userInfo
);
console
.
info
(
this
.
userInfo
);
// todo 登录请求
// todo 登录请求
this
.
$axios
this
.
$axios
...
@@ -74,9 +75,23 @@ export default {
...
@@ -74,9 +75,23 @@ export default {
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
info
(
res
);
console
.
info
(
res
);
if
(
res
.
data
.
code
===
"200"
)
{
if
(
res
.
data
.
code
===
"200"
)
{
let
token
=
res
.
data
.
token
;
console
.
info
(
token
);
me
.
$store
.
commit
(
"user/SET_TOKEN"
,
token
);
// this.$store.dispatch("login", {});
this
.
$message
.
success
(
userinfo
.
userName
+
"登录成功!"
);
this
.
$message
.
success
(
userinfo
.
userName
+
"登录成功!"
);
console
.
info
(
this
.
$store
);
if
(
this
.
$store
.
state
.
user
.
token
)
{
this
.
$router
.
push
(
"/Home/Home"
);
this
.
$router
.
push
(
"/Home/Home"
);
}
else
{
this
.
$router
.
replace
(
"/login1"
);
}
}
}
})
.
catch
(
err
=>
{
// this.$message.error(err.message);
// this.getCaptcha();
console
.
info
(
err
);
});
});
// "/myLoginForm?userName=" +
// "/myLoginForm?userName=" +
...
@@ -111,10 +126,6 @@ export default {
...
@@ -111,10 +126,6 @@ export default {
// });
// });
// }
// }
// })
// })
// .catch(err => {
// this.$message.error(err.message);
// this.getCaptcha();
// });
}
}
},
},
mounted
()
{
mounted
()
{
...
...
vue.config.js
View file @
2c8e5fea
...
@@ -101,6 +101,14 @@ module.exports = {
...
@@ -101,6 +101,14 @@ module.exports = {
pathRewrite
:
{
pathRewrite
:
{
"^/login"
:
""
"^/login"
:
""
}
}
},
"/logout"
:
{
target
:
"http://47.92.226.24:3004/"
,
// 登录
ws
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
"^/login"
:
"/login"
}
}
}
// 阿里
// 阿里
// "/api": {
// "/api": {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment