优化页面
This commit is contained in:
106
unpackage/dist/dev/mp-weixin/pages/login/login.js
vendored
106
unpackage/dist/dev/mp-weixin/pages/login/login.js
vendored
@@ -1,106 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_request = require("../../components/request.js");
|
||||
const components_debug_GenerateTestUserSig = require("../../components/debug/GenerateTestUserSig.js");
|
||||
const components_TUILogin = require("../../components/TUILogin.js");
|
||||
const stores_counter = require("../../stores/counter.js");
|
||||
const counter = stores_counter.useCounterStore();
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},
|
||||
info: {},
|
||||
userSig: "",
|
||||
lastPage: "",
|
||||
myuserSig: ""
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
common_vendor.index.getUserInfo({
|
||||
provider: "weixin",
|
||||
success: (res) => {
|
||||
this.userInfo = res.userInfo;
|
||||
}
|
||||
});
|
||||
common_vendor.index.getStorage({
|
||||
key: "lastPage",
|
||||
success: (res) => {
|
||||
this.lastPage = "/" + res.data;
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:40", this.lastPage);
|
||||
},
|
||||
fail: () => {
|
||||
this.lastPage = "/pages/Home/Home";
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取手机号
|
||||
async getPhoneNumber(e) {
|
||||
common_vendor.index.showLoading({
|
||||
title: "登录中...",
|
||||
mask: true
|
||||
});
|
||||
const res = await components_request.request({
|
||||
url: "user/loginWithPhoneNumber",
|
||||
method: "POST",
|
||||
data: {
|
||||
code: e.detail.code
|
||||
},
|
||||
userInfo: false
|
||||
});
|
||||
this.info = res;
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:64", "登录信息", this.info);
|
||||
const sdkAppID = Number(this.info.data.chatInfo.appId);
|
||||
const userID = "administrator";
|
||||
this.userSig = components_debug_GenerateTestUserSig.genTestUserSig({
|
||||
SDKAPPID: sdkAppID,
|
||||
SECRETKEY: this.info.data.chatInfo.appKey,
|
||||
userID
|
||||
});
|
||||
this.myuserSig = components_debug_GenerateTestUserSig.genTestUserSig({
|
||||
SDKAPPID: sdkAppID,
|
||||
SECRETKEY: this.info.data.chatInfo.appKey,
|
||||
userID: String(res.data.info.id)
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:77", "userSig", this.myuserSig.userSig);
|
||||
common_vendor.index.setStorageSync("myuserSig", this.myuserSig);
|
||||
common_vendor.index.setStorageSync("chatInfo", this.info.data.chatInfo);
|
||||
common_vendor.index.setStorageSync("userSig", this.userSig);
|
||||
common_vendor.index.setStorageSync("userinfo", this.info.data.info);
|
||||
counter.$patch({ myitem: this.info.data.info });
|
||||
if (this.info.code === 200) {
|
||||
if (this.info.data.newAccount) {
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/UserInformation/UserInformation"
|
||||
});
|
||||
components_TUILogin.TUIlogin(this.info.data.chatInfo.appId, this.info.data.info.id, this.myuserSig.userSig);
|
||||
common_vendor.index.hideLoading();
|
||||
} else {
|
||||
common_vendor.index.setStorageSync("userinfo", this.info.data.info);
|
||||
components_TUILogin.TUIlogin(this.info.data.chatInfo.appId, this.info.data.info.id, this.myuserSig.userSig);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:95", "跳的地址", this.lastPage);
|
||||
common_vendor.index.reLaunch({
|
||||
url: this.lastPage
|
||||
});
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "登录失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.userInfo.avatarUrl,
|
||||
b: common_vendor.t($data.userInfo.nickName),
|
||||
c: common_vendor.o$1((...args) => $options.getPhoneNumber && $options.getPhoneNumber(...args))
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/login.js.map
|
||||
Reference in New Issue
Block a user