main #98

Merged
charles merged 7 commits from main into prod 2026-04-27 11:07:18 +08:00
Showing only changes of commit 89fed5a6ea - Show all commits

View File

@ -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;
} }
// 使APImobileaction_type // 使APImobileaction_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;