feat:微信登录

This commit is contained in:
2025-09-25 15:40:53 +08:00
parent a22b987ed9
commit fa8c41a4f7
7 changed files with 665 additions and 555 deletions
+18 -4
View File
@@ -62,7 +62,7 @@
<script>
import { SMS_TYPE } from "@/utils/enumUtils.js";
import { getUserList } from "@/api/common.js";
import { wechatLogin,alipayLogin } from "@/api/auth.js";
import { wechatLogin, alipayLogin } from "@/api/auth.js";
import {
setStorageFun,
TOKEN_NAME,
@@ -96,7 +96,7 @@ export default {
onLoad(option) {
this.form.token = option.token;
this.type = option.type;
console.log("-----1", option, this.form.token, this.type );
console.log("-----1", option, this.form.token, this.type);
},
methods: {
jumpMine() {
@@ -129,7 +129,8 @@ export default {
isValid: true,
token: form.token,
};
const response = this.type == 1 ? await wechatLogin(params) : await alipayLogin(params);
const response =
this.type == 1 ? await wechatLogin(params) : await alipayLogin(params);
console.log("微信登录接口返回:", params, response);
if (response && response.bizcode === 100) {
const data = response.data;
@@ -147,6 +148,19 @@ export default {
// 当前登录得时间戳
let currentTimeStamp = new Date().getTime();
setStorageFun(USER_LOGIN_TIME, currentTimeStamp);
const res = uni.getSystemInfoSync();
uni.setStorageSync("platform", res.platform);
// #ifdef APP-PLUS
// 获取应用版本信息
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
console.log("版本信息", inf.versionCode);
uni.setStorageSync("version-1", inf.version); // 大版本号
uni.setStorageSync("versionCode", inf.versionCode); // 小版本号
});
let uuid = plus.device.uuid;
// #endif
this.$refs.uToastRef.show({
type: "success",
message: response.msg,
@@ -176,7 +190,7 @@ export default {
const params = {
mobile: form.mobile,
type:this.type == 1 ? SMS_TYPE.WECHAT : SMS_TYPE.ALIPAY,
type: this.type == 1 ? SMS_TYPE.WECHAT : SMS_TYPE.ALIPAY,
};
const response = await getUserList(params);
if (response && response.bizcode === 100) {