在搞加密解密
This commit is contained in:
@@ -5,19 +5,21 @@
|
||||
<block slot="backText">返回</block>
|
||||
</cu-custom>
|
||||
<view class="pannel">
|
||||
<view class="logo margin-top">
|
||||
<img :src="baseURL+'/static/img/order-xy.png'" mode="" />
|
||||
<view class="text-center">
|
||||
<text class="text-bold text-lg text-black">{{oilSite.oilSiteName}}</text>
|
||||
<view class="bg-img margin radius flex align-center" :style="'background-image: url('+mainURL+'login-bg.png)'">
|
||||
<view class="padding-xl text-white">
|
||||
<view class="padding-xs text-lg text-bold">
|
||||
{{oilSite.oilSiteName}}
|
||||
</view>
|
||||
<view class="padding-xs text-lg">
|
||||
星油云站欢迎您的加入
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-gradual-orange margin padding radius shadow-warp">
|
||||
<view class="text-bold text-lg padding-bottom text-center">
|
||||
星油云站欢迎您的加入
|
||||
</view>
|
||||
<view class=" padding-bottom text-center">
|
||||
请确认您的手机号码已注册星油云站管理员账号
|
||||
|
||||
</view>
|
||||
|
||||
<view class="radius">
|
||||
|
||||
<view class="cu-form-group">
|
||||
@@ -28,10 +30,7 @@
|
||||
<view class="title text-black">工号</view>
|
||||
<input v-model="oilSiteNo" placeholder="请输入云站编号" name="input"></input>
|
||||
</view> -->
|
||||
<view class="cu-form-group">
|
||||
<view class="title text-black">身份证</view>
|
||||
<input type="idcard" v-model="auth.idNumber" placeholder="请输入身份证号" name="input"></input>
|
||||
</view>
|
||||
|
||||
<view class="cu-form-group">
|
||||
<view class="title text-black">手机号</view>
|
||||
<input type="number" v-model="auth.phone" placeholder="请输入手机号" name="input"></input>
|
||||
@@ -43,6 +42,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-left">
|
||||
<text class="cuIcon-infofill padding-right-xs text-sm oil-main-color"></text>
|
||||
<text class="text-sm">请确认您的手机号已添加为星油云站管理员账号</text>
|
||||
</view>
|
||||
<view class="margin margin-top-xl">
|
||||
<!-- <button class="bg-main-oil" @tap="beforeLogin" open-type="getUserInfo" @getuserinfo="getUserInfo">
|
||||
确认
|
||||
@@ -62,6 +65,7 @@
|
||||
return {
|
||||
baseURL: this.global.baseURL,
|
||||
forcedLogin: true,
|
||||
mainURL: this.global.mainURL,
|
||||
oilSiteNo: '',
|
||||
oilSite: {},
|
||||
auth: {
|
||||
@@ -70,6 +74,7 @@
|
||||
};
|
||||
},
|
||||
created() {
|
||||
uni.showShareMenu()
|
||||
// this.loginWeixin()
|
||||
uni.getStorage({
|
||||
key: 'oilSiteCode',
|
||||
@@ -100,6 +105,7 @@
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
@@ -127,6 +133,81 @@
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
if(res.code ===20000){
|
||||
this.loginWeixin()
|
||||
uni.setStorage({
|
||||
key: 'Authorization',
|
||||
data: res.data.accessToken,
|
||||
success: () => {
|
||||
console.log('Authorization成功', res.data.accessToken)
|
||||
}
|
||||
})
|
||||
uni.setStorage({
|
||||
key: 'device',
|
||||
data: res.data.openid,
|
||||
success: () => {
|
||||
console.log('deviceopenid', res.data.openid)
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('userMenu',res.data.loginUser.procedureAuthList)
|
||||
uni.setStorageSync('loginUser',{id:res.data.loginUser.id,name:res.data.loginUser.name})
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
},
|
||||
loginWeixin() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
const code = loginRes.code
|
||||
console.log(code)
|
||||
loginApi.loginWeixin(code).then(res => {
|
||||
if (res.code === 20000) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'success',
|
||||
duration: 3000
|
||||
})
|
||||
uni.setStorage({
|
||||
key: 'Authorization',
|
||||
data: res.data.accessToken,
|
||||
success: () => {
|
||||
console.log('Authorization成功', res.data.accessToken)
|
||||
}
|
||||
})
|
||||
uni.setStorage({
|
||||
key: 'device',
|
||||
data: res.data.openid,
|
||||
success: () => {
|
||||
console.log('deviceopenid', res.data.openid)
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('userMenu',res.data.loginUser.procedureAuthList)
|
||||
uni.setStorageSync('loginUser',{id:res.data.loginUser.id,name:res.data.loginUser.name})
|
||||
} else {
|
||||
console.log('res', res.code)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
@@ -151,14 +232,7 @@
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (!this.auth.idNumber) {
|
||||
uni.showToast({
|
||||
title: '请输入身份证号',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.auth.captcha) {
|
||||
uni.showToast({
|
||||
title: '请输入短信验证码',
|
||||
@@ -232,26 +306,8 @@
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
},
|
||||
loginWeixin() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: loginRes => {
|
||||
const code = loginRes.code
|
||||
console.log(code)
|
||||
loginApi.loginWeixin(code).then(res => {
|
||||
console.log('res', res)
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user