Skip to content

Commit 132d1fb

Browse files
committed
fix: wxwork qrcode login
1 parent 10f428c commit 132d1fb

File tree

4 files changed

+797
-584
lines changed

4 files changed

+797
-584
lines changed

Back/model/user.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { prisma, User, UserCreateInput } from "../generated/prisma-client";
22
import fetch from "node-fetch";
3-
import { scanningURL, userIDURL, getQRCodeURL, pagesize } from "./consts";
3+
import { scanningURL, userIDURL, ssoQRCodeURL, pagesize } from "./consts";
44
import { Request, Response } from "express";
55
import {
66
addSaltPasswordOnce,
@@ -436,7 +436,7 @@ export const userScan = async function(req: Request, res: Response) {
436436

437437
export const userQRLogin = async function(_req: Request, res: Response) {
438438
try {
439-
const response = await fetch(getQRCodeURL);
439+
const response = await fetch(ssoQRCodeURL);
440440
const data = JSON.parse(await response.text());
441441
const qrcodeSrc: string = data.serviceResponse.authenticationSuccess.qrcodeSrc;
442442
const key = qrcodeSrc.match(/key=(\w+)/)![0].replace(/key=/, "");

Front/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"vue": "^2.6.5",
1919
"vue-codemirror": "^4.0.6",
2020
"vue-router": "^3.0.1",
21-
"vuex": "^3.1.0"
21+
"vuex": "^3.1.0",
22+
"webpack-cli": "3"
2223
},
2324
"devDependencies": {
2425
"autoprefixer": "^7.1.2",
@@ -55,7 +56,7 @@
5556
"vue-template-compiler": "^2.6.5",
5657
"webpack": "^3.6.0",
5758
"webpack-bundle-analyzer": "^3.3.2",
58-
"webpack-dev-server": "^3.1.11",
59+
"webpack-dev-server": "2.7.1",
5960
"webpack-merge": "^4.1.0"
6061
},
6162
"optionalDependencies": {

Front/src/web/user/userLoginWx.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export default {
3030
};
3131
},
3232
methods: {
33+
async getStatusRaw() {
34+
return await this.$ajax.get(
35+
this.$urls.wxLoginGetStatus(this.key)
36+
);
37+
},
3338
async getKey() {
3439
const pageIntoTime = this.$store.state.wxGoPageTime;
3540
@@ -92,13 +97,6 @@ export default {
9297
beforeDestroy() {
9398
this.onPage = false;
9499
},
95-
methods: {
96-
async getStatusRaw() {
97-
return await this.$ajax.get(
98-
this.$urls.wxLoginGetStatus(this.key)
99-
);
100-
}
101-
}
102100
};
103101
</script>
104102
<style scoped>

0 commit comments

Comments
 (0)