This commit is contained in:
cansnow
2026-01-09 09:15:59 +08:00
parent 78386d4cc1
commit 7913a63a39
51 changed files with 1048 additions and 449 deletions
+30 -31
View File
@@ -158,37 +158,35 @@ export default {
});
},
async startLogin() {
this.$refs.loginForm.validate().then(async (valid) => {
this.loading = true;
this.saveLoginInfo();
let data = {};
try {
data = await businessLogin({
mobile: this.loginInfo.phoneNumber,
email: this.loginInfo.email,
region: `+${this.loginInfo.region}`,
password: this.isPwdLogin ? md5(this.loginInfo.password) : "",
platform: uni.$u.os(),
type: this.active === 0 ? 'mobile' : 'email',
code: this.loginInfo.verificationCode,
});
const { imToken, userID } = data;
this.saveLoginProfile(data);
this.$store.commit("user/SET_AUTH_DATA", data);
this.loginInfo.password = "";
// #ifdef APP
// await IMSDK.asyncApi(IMSDK.IMMethods.Login, uuidv4(), {
// userID,
// token: imToken,
// });
plus.runtime.restart();
// #endif
} catch (err) {
console.error(err);
uni.$u.toast(checkLoginError(err));
}
this.loading = false;
});
this.loading = true;
this.saveLoginInfo();
let data = {};
try {
data = await businessLogin({
mobile: this.loginInfo.phoneNumber,
email: this.loginInfo.email,
region: `+${this.loginInfo.region}`,
password: this.isPwdLogin ? md5(this.loginInfo.password) : "",
platform: uni.$u.os(),
type: this.active === 0 ? 'mobile' : 'email',
code: this.loginInfo.verificationCode,
});
const { imToken, userID } = data;
this.saveLoginProfile(data);
this.$store.commit("user/SET_AUTH_DATA", data);
this.loginInfo.password = "";
// #ifdef APP
// await IMSDK.asyncApi(IMSDK.IMMethods.Login, uuidv4(), {
// userID,
// token: imToken,
// });
plus.runtime.restart();
// #endif
} catch (err) {
console.error(err);
uni.$u.toast(checkLoginError(err));
}
this.loading = false;
},
saveLoginProfile(data) {
const { imToken, token, userID } = data;
@@ -275,6 +273,7 @@ export default {
align-items: center;
img {
border-radius: 32rpx;
width: 160rpx;
height: 160rpx;
}