Skip to content

Commit d32406f

Browse files
YunaiVgitee-org
authored andcommitted
!317 优化 vue3 配置,修复部分 bug
Merge pull request !317 from xingyu/dev
2 parents 5fb2cdb + e2546fd commit d32406f

File tree

2 files changed

+35
-14
lines changed

2 files changed

+35
-14
lines changed

src/components/Verifition/Verify/VerifyPoints.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ export default {
223223
this.checkPosArr.splice(0, this.checkPosArr.length)
224224
this.num = 1
225225
this.getPictrue()
226-
this.text = '验证失败'
227226
this.showRefresh = true
228227
},
229228

src/views/login.vue

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@
5353
<el-form-item prop="mobileCode">
5454
<el-input v-model="loginForm.mobileCode" type="text" auto-complete="off" placeholder="短信验证码"
5555
@keyup.enter.native="handleLogin">
56-
<template slot="icon">
56+
<template v-slot="icon">
5757
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
5858
</template>
59-
<template slot="append">
59+
<template v-slot="append">
6060
<span v-if="mobileCodeTimer <= 0" class="getMobileCode" @click="getSmsCode" style="cursor: pointer;">获取验证码</span>
6161
<span v-if="mobileCodeTimer > 0" class="getMobileCode">{{ mobileCodeTimer }}秒后可重新获取</span>
6262
</template>
@@ -115,6 +115,7 @@ import {
115115
} from "@/utils/auth";
116116
117117
import Verify from '@/components/Verifition/Verify';
118+
import {resetUserPwd} from "@/api/system/user";
118119
119120
export default {
120121
name: "Login",
@@ -254,19 +255,40 @@ export default {
254255
}
255256
});
256257
},
257-
doSocialLogin(socialTypeEnum) {
258+
async doSocialLogin(socialTypeEnum) {
258259
// 设置登录中
259260
this.loading = true;
260-
// 计算 redirectUri
261-
const redirectUri = location.origin + '/social-login?'
262-
+ encodeURIComponent('type=' + socialTypeEnum.type + '&redirect=' + (this.redirect || "/")); // 重定向不能丢
263-
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
264-
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
265-
// 进行跳转
266-
socialAuthRedirect(socialTypeEnum.type, encodeURIComponent(redirectUri)).then((res) => {
267-
// console.log(res.url);
268-
window.location.href = res.data;
269-
});
261+
let tenant = false;
262+
if (this.tenantEnable) {
263+
await this.$prompt('请输入租户名称', "提示", {
264+
confirmButtonText: "确定",
265+
cancelButtonText: "取消"
266+
}).then(({value}) => {
267+
getTenantIdByName(value).then(res => {
268+
const tenantId = res.data;
269+
tenant = true
270+
if (tenantId && tenantId >= 0) {
271+
setTenantId(tenantId)
272+
}
273+
});
274+
}).catch(() => {
275+
return false
276+
});
277+
} else {
278+
tenant = true
279+
}
280+
if(tenant){
281+
// 计算 redirectUri
282+
const redirectUri = location.origin + '/social-login?'
283+
+ encodeURIComponent('type=' + socialTypeEnum.type + '&redirect=' + (this.redirect || "/")); // 重定向不能丢
284+
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
285+
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
286+
// 进行跳转
287+
socialAuthRedirect(socialTypeEnum.type, encodeURIComponent(redirectUri)).then((res) => {
288+
// console.log(res.url);
289+
window.location.href = res.data;
290+
});
291+
}
270292
},
271293
/** ========== 以下为升级短信登录 ========== */
272294
getSmsCode() {

0 commit comments

Comments
 (0)