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