Skip to content

Commit

Permalink
增加登陆
Browse files Browse the repository at this point in the history
  • Loading branch information
shitiandmw committed Nov 6, 2023
1 parent 08f0f62 commit e39a463
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions client/src/pages/login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<view class="phone-container p-0 px-6 pt-10">
<login
v-if="pupup_index == 0"
@success="loginSuccess"
@goRegister="pupup_index = 1"
></login>
<register
v-else
@goLogin="pupup_index = 0"
@success="registerSuccess"
></register>
</view>
</template>

<script>
import lpopup from "@/components/popup.vue";
import login from "@/pages/components/login.vue";
import register from "@/pages/components/register.vue";
import { mapState, mapMutations, mapActions } from "vuex";
export default {
data() {
return {
pupup_index: 0,
title: "Hello",
redirect: "",
};
},
onLoad(option) {
this.redirect = option.redirect;
console.log("option", option);
},
methods: {
loginSuccess(){
this.goRedirect();
},
registerSuccess(){
this.goRedirect();
},
goRedirect(){
var pages = getCurrentPages();
if(pages.length > 1)
uni.navigateBack();
else if(this.redirect && this.redirect.length > 0) {
uni.reLaunch({
url: this.redirect ,
});
}
else uni.reLaunch({url:"/pages/tab/templates"});
}
},
onShow() {
},
computed: {
},
components: { lpopup, login, register },
};
</script>

<style>
</style>

0 comments on commit e39a463

Please sign in to comment.