解绑openId

This commit is contained in:
nisen
2023-10-17 15:43:13 +08:00
parent 6f4ef2e32a
commit eb9e3f6b91
4 changed files with 81 additions and 10 deletions

View File

@@ -96,6 +96,14 @@ const logout = function() {
return ajax.postJson('/logout',{"from":plat});
}
// 获取用户解绑状态
const hasOpenId = function(){
return ajax.post('/user/hasOpenId',{});
}
// 解绑unopenId
const UnOpenId = function(){
return ajax.post('/user/UnOpenId',{});
}
export default {
userParentOrg,
findOrgsByKeyword,
@@ -107,5 +115,7 @@ export default {
modifyPassword,
getInAudienceIds,
updateUser,
logout
logout,
hasOpenId,
UnOpenId
}

View File

@@ -19,9 +19,9 @@ if(process.env.NODE_ENV === 'development'){
oldApiBaseUrl = '/uboeApi';
statApiBaseUrl='/statApi';
socialApiBaseUrl='/socialApi';
fileUrl = 'http://127.0.0.1:9090/cdn/upload';
fileUrl = 'https://u-pre.boe.com/cdn/upload';
loginPath='/mobile/pages/login/login';
scormPlayer='http://localhost:9083/scorm-player';
scormPlayer='https://u-pre.boe.com/scorm-player';
}else if(process.env.ENV_TYPE === 'preview'){
// 预发布环境,当前配置未使用上
context='/mobile-release';

View File

@@ -74,11 +74,11 @@
"https" : false,
"proxy" : {
"/systemapi" : {
"target" : "http://127.0.0.1:9090",
"target" : "https://u-pre.boe.com",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/systemapi" : ""
// "^/systemapi" : ""
}
},
"/userbasic" : {
@@ -107,22 +107,22 @@
},
"/statApi" : {
// 目标代理服务器地址
"target" : "http://127.0.0.1:9080",
"target" : "https://u-pre.boe.com",
"changeOrigin" : true,
"logLevel" : "debug",
"secure" : false,
"pathRewrite" : {
"^/statApi" : ""
// "^/statApi" : ""
}
},
"/socialApi" : {
// 目标代理服务器地址
"target" : "http://127.0.0.1:9081",
"target" : "https://u-pre.boe.com",
"changeOrigin" : true,
"logLevel" : "debug",
"secure" : false,
"pathRewrite" : {
"^/socialApi" : ""
// "^/socialApi" : ""
}
}
}

View File

@@ -50,7 +50,12 @@
<!-- <u-cell title="语言设置" v-model="userInfoObj.name"></u-cell>
<u-cell title="位置" v-model="userInfoObj.name"></u-cell> -->
<u-cell @click="toRouter('next')" title="修改密码" :isLink="true" arrow-direction="left" v-model="userInfoObj.account.passValue"></u-cell>
</u-cell-group>
<u-cell title="解除绑定">
<view slot="value" class="relieveLogin" :class="!relieveStatus ? 'noRelieveLogin' : 'activeRelieveLogin'" @click="relieveLogin(relieveStatus)">
<text>解除</text>
</view>
</u-cell>
</u-cell-group>
</view>
</view>
</view>
@@ -69,6 +74,7 @@
import cropper from "@/components/x-cropper/x-cropper.vue"
import { mapGetters } from 'vuex';
import {getToken} from '@/utils/token.js'
import userBasic from '@/api/boe/userbasic.js'
export default {
components: {cropper},
data() {
@@ -80,6 +86,7 @@
},
clearShow:false,
imgurl:"",
relieveStatus:false
}
},
computed: {
@@ -90,12 +97,43 @@
this.aid=rs.aid;
this.imgurl = rs.avatar;
this.load();
this.getRelieveStatus();
})
},
onLoad(){
//this.load()
},
methods: {
relieveLogin(relieveStatus){
if(relieveStatus){
userBasic.UnOpenId().then(res=>{
if(res.status==200){
uni.showToast({
title: "解绑成功",
icon:'none'
});
}else{
uni.showToast({
title: "解绑失败",
icon:'none'
});
}
})
}
},
// 解绑状态
getRelieveStatus(){
userBasic.hasOpenId().then(res=>{
if(res.status==200){
this.relieveStatus = res.result
}else{
uni.showToast({
title: "获取数据失败",
icon:'none'
});
}
})
},
logout() {
this.clearShow=true;
},
@@ -218,6 +256,29 @@
</script>
<style lang="scss" scoped>
.relieveLogin{
width: 40px;
text-align: center;
border-radius: 3px;
text {
font-size: 14px;
line-height: 22px;
}
}
.activeRelieveLogin{
color: red;
border: 1px solid red;
text{
color: red !important;
}
}
.noRelieveLogin{
border: 1px solid #ccc;
color: #ccc;
text{
color: #ccc !important;
}
}
/deep/ .u-modal{
width: 288px !important;
border-radius: 28upx;