|
@@ -11,8 +11,11 @@
|
|
|
|
|
|
<script>
|
|
|
import token from '../../utils/token.js';
|
|
|
+ import user from '../../utils/user.js';
|
|
|
import pages from '../../utils/pages.js';
|
|
|
|
|
|
+ let userinfo = null;
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -20,11 +23,24 @@
|
|
|
menus: []
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ async onShow() {
|
|
|
if (token.has()) {
|
|
|
+ userinfo = user.get();
|
|
|
this.isLogin = true;
|
|
|
+ this.menus = pages.pages;
|
|
|
+ } else {
|
|
|
+ let res = await token.getByServer();
|
|
|
+ if (res.success) {
|
|
|
+ let infoRes = user.getByServer();
|
|
|
+ if (infoRes.success) {
|
|
|
+ userinfo = infoRes.data;
|
|
|
+ this.isLogin = true;
|
|
|
+ this.menus = pages.pages;
|
|
|
+ } else {
|
|
|
+ token.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- this.menus = pages.pages;
|
|
|
},
|
|
|
methods: {
|
|
|
openPage(url) {
|
|
@@ -40,6 +56,7 @@
|
|
|
page {
|
|
|
background-color: rgb(235, 235, 235);
|
|
|
}
|
|
|
+
|
|
|
.content {
|
|
|
.card {
|
|
|
position: relative;
|
|
@@ -61,7 +78,7 @@
|
|
|
color: rgb(50, 50, 50);
|
|
|
border: 2upx solid rgb(230, 230, 230);
|
|
|
background-color: rgb(245, 245, 245);
|
|
|
-
|
|
|
+
|
|
|
.card-item-text {
|
|
|
margin-top: 15upx;
|
|
|
}
|