|
@@ -57,11 +57,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="page_jg_20"></div>
|
|
<div class="page_jg_20"></div>
|
|
|
<div class="page_dialog">
|
|
<div class="page_dialog">
|
|
|
- <el-dialog title="绑定手机号" center :visible.sync="bindingPhoneData.showDialog" width="400px">
|
|
|
|
|
|
|
+ <el-dialog title="绑定手机号(用于找回密码)" center :visible.sync="bindingPhoneData.showDialog" width="400px">
|
|
|
<div class="dialog_center padding_20">
|
|
<div class="dialog_center padding_20">
|
|
|
<div class="bingding_center">
|
|
<div class="bingding_center">
|
|
|
<div class="bingding_input">
|
|
<div class="bingding_input">
|
|
|
- <el-input v-model="bindingPhoneData.phone" placeholder="请输入手机号" prefix-icon="iconfont icon_shoujihao" />
|
|
|
|
|
|
|
+ <el-input v-model="bindingPhoneData.phone" placeholder="请输入手机号" maxlength="11" prefix-icon="iconfont icon_shoujihao" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bingding_input">
|
|
<div class="bingding_input">
|
|
|
<el-input v-model="bindingPhoneData.code" placeholder="请输入验证码" prefix-icon="iconfont icon_yanzhengma">
|
|
<el-input v-model="bindingPhoneData.code" placeholder="请输入验证码" prefix-icon="iconfont icon_yanzhengma">
|
|
@@ -75,15 +75,14 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <el-dialog title="绑定微信" center :visible.sync="showWeChartDialog" width="400px" @close="CloseWeChartDialog">
|
|
|
|
|
|
|
+ <el-dialog title="绑定微信(快捷登录)" center :visible.sync="showWeChartDialog" width="400px" @close="CloseWeChartDialog">
|
|
|
<div class="dialog_center padding_20">
|
|
<div class="dialog_center padding_20">
|
|
|
- <div class="bingding_center wechar_qr" id="wechat-qr-container" style="width: 250px; height: 250px; transform: scale(0.8); transform-origin: 0 0;" v-loading="qrLoading"></div>
|
|
|
|
|
|
|
+ <div class="bingding_center wechar_qr" id="wechat-qr-container" v-loading="qrLoading"></div>
|
|
|
<div class="wechart_img">
|
|
<div class="wechart_img">
|
|
|
<img src="@/assets/login/login_wechat.webp" alt="" />
|
|
<img src="@/assets/login/login_wechat.webp" alt="" />
|
|
|
|
|
+ <p class="wechar_text">微信扫描</p>
|
|
|
</div>
|
|
</div>
|
|
|
- <p class="wechar_text">
|
|
|
|
|
-
|
|
|
|
|
- 微信扫描</p>
|
|
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</div>
|
|
</div>
|
|
@@ -140,6 +139,16 @@ export default {
|
|
|
{
|
|
{
|
|
|
this.roleNames=this.userInfo.roleNames.join("、");
|
|
this.roleNames=this.userInfo.roleNames.join("、");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //判断是否绑定了手机号
|
|
|
|
|
+ if(this.userInfo.phone)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ this.OpenPhoneDialog();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
this.LoadSdk() //加载微信sdk
|
|
this.LoadSdk() //加载微信sdk
|
|
@@ -190,7 +199,15 @@ export default {
|
|
|
this.bindingPhoneData.code = ''
|
|
this.bindingPhoneData.code = ''
|
|
|
this.codeText = '获取验证码'
|
|
this.codeText = '获取验证码'
|
|
|
this.isCount = false
|
|
this.isCount = false
|
|
|
- this.count = 60
|
|
|
|
|
|
|
+ this.count = 60;
|
|
|
|
|
+ if(this.userInfo.wxName)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ this.OpenWeChartDialog();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -209,6 +226,13 @@ export default {
|
|
|
this.$message.warning('请输入手机号码');
|
|
this.$message.warning('请输入手机号码');
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 验证手机号格式和位数
|
|
|
|
|
+ const phoneRegex = /^1[3-9]\d{9}$/;
|
|
|
|
|
+ if (!phoneRegex.test(this.bindingPhoneData.phone)) {
|
|
|
|
|
+ this.$message.warning('请输入正确的手机号码');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if(this.isCount) return
|
|
if(this.isCount) return
|
|
|
this.$api.user.getBindPhoneValidCode({
|
|
this.$api.user.getBindPhoneValidCode({
|
|
|
phoneNumber: this.bindingPhoneData.phone
|
|
phoneNumber: this.bindingPhoneData.phone
|
|
@@ -262,6 +286,7 @@ export default {
|
|
|
console.log(container)
|
|
console.log(container)
|
|
|
if (!container || container.children.length > 0) return; // 防止重复渲染
|
|
if (!container || container.children.length > 0) return; // 防止重复渲染
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const queryString = this.wechatUrl.split('?')[1]?.split('#')[0];
|
|
const queryString = this.wechatUrl.split('?')[1]?.split('#')[0];
|
|
|
const urlParams = new URLSearchParams(queryString)
|
|
const urlParams = new URLSearchParams(queryString)
|
|
|
const appid = urlParams.get('appid')
|
|
const appid = urlParams.get('appid')
|
|
@@ -274,8 +299,24 @@ export default {
|
|
|
redirect_uri: encodeURIComponent(process.env.VUE_APP_BASE+"/#/wechatLogin"), // 回调 URL
|
|
redirect_uri: encodeURIComponent(process.env.VUE_APP_BASE+"/#/wechatLogin"), // 回调 URL
|
|
|
state: "STATE", // 可选状态值
|
|
state: "STATE", // 可选状态值
|
|
|
style: "black", // 样式风格
|
|
style: "black", // 样式风格
|
|
|
- stylelite: 1 // 新版二维码样式
|
|
|
|
|
|
|
+ stylelite: 1 , // 新版二维码样式
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ // 定时调整 iframe 大小
|
|
|
|
|
+ const resizeInterval = setInterval(() => {
|
|
|
|
|
+ const iframe = container.querySelector('iframe');
|
|
|
|
|
+ if (iframe) {
|
|
|
|
|
+ iframe.style.width = '250px';
|
|
|
|
|
+ iframe.style.height = '160px';
|
|
|
|
|
+ iframe.style.border = 'none';
|
|
|
|
|
+ clearInterval(resizeInterval);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+
|
|
|
|
|
+ // 设置超时防止无限循环
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ clearInterval(resizeInterval);
|
|
|
|
|
+ }, 3000);
|
|
|
},
|
|
},
|
|
|
// 扫码绑定微信
|
|
// 扫码绑定微信
|
|
|
WechatBind(event) {
|
|
WechatBind(event) {
|
|
@@ -324,17 +365,36 @@ export default {
|
|
|
.wechart_img
|
|
.wechart_img
|
|
|
{
|
|
{
|
|
|
margin: auto;
|
|
margin: auto;
|
|
|
- text-align: center;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ height: 40px;
|
|
|
img
|
|
img
|
|
|
{
|
|
{
|
|
|
width: 32px;
|
|
width: 32px;
|
|
|
height: 32px;
|
|
height: 32px;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .wechar_text
|
|
|
|
|
+ {
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ margin-left: 5px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-.wechar_text
|
|
|
|
|
-{
|
|
|
|
|
- text-align: center;
|
|
|
|
|
|
|
+
|
|
|
|
|
+#wechat-qr-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ min-height: 160px;
|
|
|
|
|
+
|
|
|
|
|
+ iframe {
|
|
|
|
|
+ width: 250px !important;
|
|
|
|
|
+ height: 250px !important;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
</style>
|
|
</style>
|