微信分享注册
This commit is contained in:
parent
a7f4597468
commit
4d63d694f3
@ -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){
|
||||
|
@ -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>
|
||||
|
@ -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) {
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user