强制判断是否登录
This commit is contained in:
parent
110bbf8232
commit
ece7767727
@ -19,6 +19,8 @@
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
@ -41,14 +43,25 @@ export default {
|
||||
};
|
||||
},
|
||||
onShow(data) {
|
||||
if(!getToken()){
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
console.log("已登录")
|
||||
this.getUserInfos()
|
||||
}
|
||||
this.customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
||||
this.getActive()
|
||||
this.getActive()
|
||||
},
|
||||
onLoad(data) {
|
||||
this.getActive()
|
||||
},
|
||||
methods: {
|
||||
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
getUserInfoRequest()
|
||||
},
|
||||
//查询营销活动列表
|
||||
async getActive() {
|
||||
let customInfo = JSON.parse(uni.getStorageSync('customerInfo'))
|
||||
@ -227,4 +240,4 @@ export default {
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -65,7 +65,7 @@
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||
import request from "@/utils/request";
|
||||
import {getUserInfo} from "@/utils/common.js";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
export default {
|
||||
components: {
|
||||
@ -112,7 +112,7 @@
|
||||
//获取当前登录用户信息
|
||||
async getServer() {
|
||||
console.log("获取用户信息")
|
||||
this.customInfo = getUserInfo()
|
||||
this.customInfo = getUserInfoRequest()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,12 +39,12 @@
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<view class="formLabel">手机号</view>
|
||||
<view class="formContainer">
|
||||
<input placeholder="请填写你的手机号" v-model="formData.phoneNumber" type="text"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="formItem">-->
|
||||
<!-- <view class="formLabel">手机号</view>-->
|
||||
<!-- <view class="formContainer">-->
|
||||
<!-- <input placeholder="请填写你的手机号" v-model="formData.phoneNumber" type="text"/>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<view class="formItem">
|
||||
<view class="formLabel">联系地址</view>
|
||||
<view class="formContainer">
|
||||
@ -52,7 +52,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="dl" @click="getlogin()">
|
||||
<text>注册</text>
|
||||
<text>保存</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
sex: "",
|
||||
idCard:"",
|
||||
birthday:"请选择你的生日",
|
||||
phoneNumber:"",
|
||||
// phoneNumber:"",
|
||||
address:"",
|
||||
},
|
||||
//性别
|
||||
@ -153,13 +153,13 @@ export default {
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){
|
||||
uni.showToast({
|
||||
title: '请填写手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
// if(""==this.formData.phoneNumber || !this.isValidPhoneNumber(this.formData.phoneNumber)){
|
||||
// uni.showToast({
|
||||
// title: '请填写手机号',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
if(""==this.formData.address){
|
||||
uni.showToast({
|
||||
title: '请填写联系地址',
|
||||
|
@ -26,7 +26,7 @@
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||
import request from "../../utils/request";
|
||||
import config from "config";
|
||||
import {getUserInfo} from "@/utils/common.js";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
|
||||
export default {
|
||||
@ -71,7 +71,7 @@ export default {
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
console.log("获取用户信息")
|
||||
this.customInfo = getUserInfo()
|
||||
getUserInfoRequest()
|
||||
},
|
||||
getList(){
|
||||
request({
|
||||
|
@ -102,7 +102,7 @@
|
||||
import request from '../../utils/request';
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import config from "@/config";
|
||||
import {getUserInfo} from "@/utils/common.js";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
|
||||
export default {
|
||||
@ -203,7 +203,7 @@
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
console.log("获取用户信息")
|
||||
this.customInfo = getUserInfo()
|
||||
getUserInfo()
|
||||
},
|
||||
initDateList(){
|
||||
const daysOfWeek = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
|
@ -18,7 +18,7 @@
|
||||
import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||
import reservationOrderVue from '../../components/reservationOrder/reservationOrder.vue'
|
||||
import request from "@/utils/request";
|
||||
import {getUserInfo} from "@/utils/common.js";
|
||||
import {getUserInfoRequest} from "@/utils/common.js";
|
||||
import {getToken,setUserInfo} from '@/utils/auth.js'
|
||||
|
||||
export default {
|
||||
@ -61,8 +61,7 @@
|
||||
methods: {
|
||||
//获取当前登录用户信息
|
||||
async getUserInfos() {
|
||||
console.log("获取用户信息")
|
||||
this.customInfo = getUserInfo()
|
||||
getUserInfoRequest()
|
||||
},
|
||||
async getBookingPage(){
|
||||
const res = await request({
|
||||
|
@ -59,7 +59,7 @@ export function tansParams(params) {
|
||||
* 获取当前登录用户信息
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function getUserInfo(){
|
||||
export async function getUserInfoRequest(){
|
||||
const res = await request({
|
||||
url: "/userClient/customer/getUserCustomer",
|
||||
method: 'get',
|
||||
|
Loading…
Reference in New Issue
Block a user