mirror of
https://github.com/RemainderTime/spring-boot-base-demo.git
synced 2026-03-06 04:00:46 +08:00
实现简单登录成功页面并传递name
This commit is contained in:
@@ -62,7 +62,9 @@
|
||||
.then(function (response) {
|
||||
var data = response.data;
|
||||
if (data.code == 200) {
|
||||
window.location.href = "success.html?token=" + data.data.token
|
||||
|
||||
var param = "?token=" + data.data.token + "&name=" + data.data.name;
|
||||
window.location.href = encodeURI("success.html" + param)
|
||||
} else {
|
||||
alert(data.message)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<h1>这是登录成功页面</h1>
|
||||
<h1>欢迎 {{name}} 登录成功~~</h1>
|
||||
<h1>
|
||||
token:
|
||||
<span style="color: forestgreen">{{token}}</span>
|
||||
@@ -21,10 +21,12 @@
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
token: ''
|
||||
token: '',
|
||||
name:''
|
||||
},
|
||||
mounted: function () {
|
||||
this.token = this.getData("token");
|
||||
this.name = decodeURI(this.getData("name"));
|
||||
},
|
||||
methods: {
|
||||
getData: function (name) {
|
||||
|
||||
Reference in New Issue
Block a user