updata
This commit is contained in:
parent
feee90ffbd
commit
89fed5a6ea
@ -699,14 +699,14 @@ export default {
|
|||||||
// 获取手机登录验证码
|
// 获取手机登录验证码
|
||||||
getCode() {
|
getCode() {
|
||||||
// 验证手机号格式
|
// 验证手机号格式
|
||||||
if (!this.loginForm.username || !/^1[3-9]\d{9}$/.test(this.loginForm.username)) {
|
if (!this.loginForm.mobile || !/^1[3-9]\d{9}$/.test(this.loginForm.mobile)) {
|
||||||
this.$message.error('请输入正确的手机号');
|
this.$message.error('请输入正确的手机号');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用新的API参数:mobile和action_type
|
// 使用新的API参数:mobile和action_type
|
||||||
getCodeAPI({
|
getCodeAPI({
|
||||||
mobile: this.loginForm.username,
|
mobile: this.loginForm.mobile,
|
||||||
action_type: 'login'
|
action_type: 'login'
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@ -815,45 +815,25 @@ export default {
|
|||||||
this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
|
this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理登录 - 账号登录保持原逻辑不变
|
// 处理登录
|
||||||
handleLogin(formName) {
|
handleLogin(formName) {
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[formName].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// 根据登录类型构建不同的API参数
|
const loginParams = {
|
||||||
let apiOneIphone = {
|
|
||||||
username: this.loginForm.username,
|
username: this.loginForm.username,
|
||||||
domain_name: this.photosUrl?.domain_name ? this.photosUrl.domain_name : '',
|
domain_name: this.photosUrl?.domain_name ? this.photosUrl.domain_name : '',
|
||||||
|
password: this.passwordEncryption(this.loginForm.password),
|
||||||
|
mobile: this.loginForm.mobile,
|
||||||
vcode: this.loginForm.vcode,
|
vcode: this.loginForm.vcode,
|
||||||
codeid: this.loginForm.codeid,
|
codeid: this.loginForm.codeid,
|
||||||
wechat_openid: this.wechat_openid
|
wechat_openid: this.wechat_openid
|
||||||
}
|
}
|
||||||
|
|
||||||
let apiOne = {
|
logintypeAPI(loginParams).then(res => {
|
||||||
username: this.loginForm.username,
|
|
||||||
domain_name: this.photosUrl?.domain_name ? this.photosUrl.domain_name : '',
|
|
||||||
password: this.passwordEncryption(this.loginForm.password),
|
|
||||||
wechat_openid: this.wechat_openid
|
|
||||||
}
|
|
||||||
|
|
||||||
let apiTwoIphone = {
|
|
||||||
username: this.loginForm.username,
|
|
||||||
vcode: this.loginForm.vcode,
|
|
||||||
codeid: this.loginForm.codeid,
|
|
||||||
wechat_openid: this.wechat_openid
|
|
||||||
}
|
|
||||||
|
|
||||||
let apiTwo = {
|
|
||||||
username: this.loginForm.username,
|
|
||||||
password: this.passwordEncryption(this.loginForm.password),
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据登录类型调用不同的API
|
|
||||||
logintypeAPI(this.loginType === '0' ? apiOne : apiOneIphone).then(res => {
|
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 执行登录
|
|
||||||
this.$store
|
this.$store
|
||||||
.dispatch("user/login", this.loginType === '0' ? apiTwo : apiTwoIphone)
|
.dispatch("user/login", loginParams)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user