Commit d84e9d30 by yuzhenWang

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

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