微信分享注册

This commit is contained in:
Vinjor 2024-10-15 18:47:56 +08:00
parent a7f4597468
commit 4d63d694f3
4 changed files with 45 additions and 13 deletions

View File

@ -152,7 +152,7 @@
url: "/app-api/base/user-car/empowerUserInfo",
method: 'get',
tenantIdFlag: false,
params:{tenantId:this.info.tenantId}
params:{tenantId:this.info.tenantId,systemCode:"04"}
}).then(res=>{
uni.hideLoading();
if(res.code==200){

View File

@ -5,9 +5,7 @@
</template>
<script>
import {
getToken
} from "@/utils/auth";
import { setInviteId ,removeInviteId} from "@/utils/auth";
export default {
data() {
@ -15,17 +13,41 @@
}
},
onLoad() {
uni.reLaunch({
url: '/pages-home/home/home'
})
onLoad(query) {
const q = decodeURIComponent(query.q) //
let theRequest = this.getUrlValue(q)
if(theRequest.hasOwnProperty("inviteId")){
//code
setInviteId(theRequest['inviteId'])
//
uni.reLaunch({
url: '/pages/login/login'
})
}else{
removeInviteId()
uni.reLaunch({
url: '/pages-home/home/home'
})
}
},
methods: {
}
//
getUrlValue(url) {
var theRequest = new Object();
if (url.indexOf("?") != -1) {
//
var str = url.split("?")[1];
var strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
}
}
return theRequest
},
}
}
</script>
<style>
</style>
</style>

View File

@ -28,7 +28,7 @@
<script>
import request from '../../utils/request';
import {setToken,setUserInfo} from '@/utils/auth.js'
import {setToken,setUserInfo,getInviteId} from '@/utils/auth.js'
export default{
data(){
return{
@ -113,7 +113,7 @@
code: uni.getStorageSync('c1'),
encryptedIv: e.detail.iv,
encryptedData: e.detail.encryptedData,
inviteId: uni.getStorageSync('inviteId') ? uni.getStorageSync('inviteId') : null
inviteId: getInviteId() ? getInviteId() : null
},
success: (rex) => {
if (rex.data.code == 0) {

View File

@ -1,6 +1,7 @@
const TokenKey = 'App-Token'
const UserInfo = 'customerInfo'
const TenantIdKey = 'TENANT_ID'
const InviteIdKey = 'INVITE_ID'
export function getToken() {
return uni.getStorageSync(TokenKey)
}
@ -19,6 +20,15 @@ export function setTenantId(TenantId) {
export function getTenantId(){
return uni.getStorageSync(TenantIdKey)
}
export function setInviteId(InviteId) {
return uni.setStorageSync(InviteIdKey, InviteId);
}
export function getInviteId(){
return uni.getStorageSync(InviteIdKey)
}
export function removeInviteId(){
return uni.removeStorageSync(InviteIdKey)
}
export function hasRole(roleCode) {
const roleList = uni.getStorageSync('role')