Commit d84e9d30 by yuzhenWang

注销账号bug已修复,已提交测试

parent 132a2700
......@@ -108,20 +108,6 @@
c_agreeFlag(){
this.agreeFlag=!this.agreeFlag;
},
// rpsdlogin(){
// if(this.loginType== 'resetpw'){
// this.loginType= 'codelogin'
// return
// }else {
// // uni.navigateBack({ delta: 1 });
// const pages = getCurrentPages();
// console.log('pages',pages);
// if (pages.length > 1) {
// uni.navigateBack({ delta: 1 });
// }
// }
// },
rpsdlogin() {
if (this.loginType == 'resetpw') {
this.loginType = 'codelogin';
......@@ -134,7 +120,6 @@
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const from = currentPage.options.from; // 获取 url 中的 from 参数
console.log('currentPage',currentPage);
// 从 TabBar 页跳转过来,用 switchTab 返回
if (from === 'index') {
uni.switchTab({
......@@ -202,6 +187,8 @@
}, 1000);
},
loginIn(loginType,urlType){
console.log('loginType',loginType);
console.log('this.loginType',this.loginType);
uni.showLoading({
title: '加载中...'
});
......
......@@ -571,7 +571,7 @@
}
//this.courseInfo.serviceContent = res['data']['data']['filePathOss'];
this.lecturerId = res['data']['data']['fileLecturerId'];
this.lecturerQuery();
// this.lecturerQuery();
this.relatedCoursesList();
if (uni.getStorageSync('h5_coursesharing')) {
this.coursesharing = uni.getStorageSync('h5_coursesharing')
......
......@@ -223,6 +223,10 @@
this.loginornot = false
}else{
this.loginornot = true;
}
if(loginType == 'codelogin'){
this.querySystemMessage()
}
this.queryAreaCenterInfo();
......
......@@ -66,8 +66,8 @@
<style lang="scss" scoped>
.container{
height: 100vh;
background: url('../../static/app-plus/registerBg.png') 100% 100%;
background-size: contain;
background: url('../../static/app-plus/registerBg.png') 30% 30% no-repeat;
background-size: cover;
color: #fff;
.logo{
padding-top: 100rpx;
......@@ -114,4 +114,4 @@
justify-content: center;
align-items: center;
}
</style>
\ No newline at end of file
</style>
......@@ -11,17 +11,16 @@
<view class="headerInfo">
<view class="headerTop">
<view class="" style="margin-right: 15rpx;">
<view class="myName" v-if="loginornot">{{showMyName || '点击头像完善信息'}}</view>
<view class="myName" v-if="!loginornot">游客</view>
<view class="myName" v-if="loginType == 'codelogin'">{{showMyName || '点击头像完善信息'}}</view>
<view class="myName" v-if="loginType == 'visitor'">游客</view>
</view>
<view class="desBox" v-if="loginornot&&customerBasicInfo.partnerType">
<view class="desBox" v-if="loginType == 'codelogin'&&customerBasicInfo.partnerType">
{{customerBasicInfo.partnerType}}
</view>
</view>
<view class="nickName">
<!--昵称:{{loginornot == true ?customerBasicInfo.nickName :'游客'}} -->
<text v-if="loginornot && customerBasicInfo.nickName">昵称:{{customerBasicInfo.nickName}}</text>
<text v-if="!loginornot">昵称:游客</text>
<text v-if="loginType == 'codelogin' && customerBasicInfo.nickName">昵称:{{customerBasicInfo.nickName}}</text>
<text v-if="loginType == 'visitor'">昵称:游客</text>
</view>
</view>
......@@ -145,12 +144,14 @@
export default {
data() {
return {
showMyName:'',
msgTotal:0,
messageInfo:[],
companyType : companyInfo.companyType,
companyLogo : '../../static/myteam/logo.png',
userId: uni.getStorageSync('cffp_userId'),
loginType : uni.getStorageSync('loginType'),
inviteEqrode:'',
currentPage:'personalCenter',
customerBasicInfo:{},
......@@ -228,21 +229,24 @@
tabBar,
},
onShow() {
this.loginType = uni.getStorageSync('loginType')
console.log('this.loginType',this.loginType);
if(this.companyType == '1'){
this.companyLogo='../../static/myteam/Group1633.png';
}else if(this.companyType == '2'){
this.companyLogo='../../static/myteam/logo.png';
}
this.queryInfo();
let loginType = uni.getStorageSync('loginType')
if(loginType == "visitor" ){
if(this.loginType == "visitor" ){
this.loginornot = false
this.messageInfo = []
}else{
this.querySystemMessage()
this.loginornot = true;
}
if(this.loginType == 'codelogin'){
this.querySystemMessage()
this.queryInfo();
}
uni.$on("handClick", res => {
this.customerBasicInfo = res.data
if(this.customerBasicInfo?.realName && this.customerBasicInfo?.realName.length>5){
......@@ -253,10 +257,6 @@
// 移除监听事件
uni.$off('handClick');
});
// setTimeout(() => {
// this.loadshow = false
// }, 10000)
},
methods: {
......@@ -285,7 +285,6 @@
}
},
jumpToSystemMsg(){
if(this.userId&& this.messageInfo.length>0){
uni.navigateTo({
url:'../systemMsg/system_msg'
......@@ -405,14 +404,20 @@
this.inviteEqrode = this.customerBasicInfo.invitationCode;
uni.setStorageSync('user_mobile', res.data.mobile)
uni.setStorageSync('userinfodataForm', res.data)
// }else{
// uni.showToast({
// title: res['message'],
// duration: 2000
// });
}else {
uni.showToast({
title: res['message'],
duration: 2000
});
// 清空全部本地存储
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor')
this.showMyName = ''
this.loginType = 'visitor'
}
console.log('this.showMyName',this.showMyName);
})
}
},
......
import {apiURL,cffpURL} from "../environments/environment";
import api from "@/api/api";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`${apiURL}/authorize/obtainToken`, `${apiURL}/authorize/checkToken`, `${cffpURL}/user/loginVerification`,`${apiURL}/appVersion/checkIsUpdate`,
`${cffpURL}/accessLog/accessLogSave`,`${cffpURL}/user/powerQuery`,`${cffpURL}/user/wxLogin`,`${cffpURL}/certificate/officialWebsiteDetail`];
......@@ -8,13 +9,16 @@ export const interceptor = () => {
invoke(args) {
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
const params = {
ticket: 'uni-app',
loginId: null
}
let h5userId = uni.getStorageSync('cffp_userId');
if (h5userId) {
params.loginId = h5userId;
}
uni.request({
url: `${apiURL}/authorize/obtainToken`,
......
import api from "@/api/api";
//只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页
// 页面白名单,不受拦截
const whiteList = [
......@@ -10,10 +11,24 @@ const whiteList = [
'/pages/index/index'
]
export default function initApp(){
uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) {
if(uni.getStorageSync('cffp_userId')){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(!res['success']){
// 清空全部本地存储
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor')
uni.redirectTo({
url: '/components/login/login'
})
return
}
})
}
let whiteArr = ['index','personalCenter','courselist','product']
// 1. 解析 URL 中的 from 参数
const getQueryParam = (url, key) => {
......@@ -65,7 +80,7 @@ function hasPermission (url) {
let islogin = uni.getStorageSync("isLogin");//在这可以使用token、vuex
// islogin = Boolean(Number(islogin));//返回布尔值
// 在白名单中或有登录判断条件可以直接跳转
console.log(whiteList.indexOf(url.slice(0,url.indexOf('?'))) !== -1);
if(whiteList.indexOf(url.slice(0,url.indexOf('?'))) !== -1 || islogin) {
return true
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment