50 lines
1.4 KiB
JavaScript
50 lines
1.4 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = {
|
|
methods: {
|
|
getAuthCode: () => {
|
|
my.getAuthCode({
|
|
scopes: "auth_user",
|
|
success: ({ authCode }) => {
|
|
console.log(`authCode:`, authCode);
|
|
my.alert({
|
|
content: authCode
|
|
});
|
|
}
|
|
});
|
|
},
|
|
handleLogin() {
|
|
common_vendor.index.login({
|
|
provider: "alipay",
|
|
success: async (loginRes) => {
|
|
const { code } = loginRes;
|
|
if (!code) {
|
|
console.log("登录失败,没有获取到 code");
|
|
return;
|
|
}
|
|
common_vendor.index.request({
|
|
url: "http://localhost:9999/api/Alipay/test/parseCode",
|
|
method: "GET",
|
|
data: {
|
|
authCode: code
|
|
},
|
|
success: (response) => {
|
|
console.log(response.data);
|
|
},
|
|
fail: (error) => {
|
|
console.error("登录失败", error.message);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: common_vendor.o((...args) => $options.handleLogin && $options.handleLogin(...args))
|
|
};
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp04/pages/feedback/feedback.vue"]]);
|
|
my.createPage(MiniProgramPage);
|