|
@@ -43,12 +43,7 @@ export default defineComponent({
|
|
|
async mounted() {
|
|
|
try {
|
|
|
const scanCode = sessionStorage.getItem('scanCode')
|
|
|
- if (scanCode) {
|
|
|
- this.scanCode = scanCode
|
|
|
- sessionStorage.removeItem('scanCode')
|
|
|
- } else {
|
|
|
- await this.getCode()
|
|
|
- }
|
|
|
+ await this.getCode(scanCode)
|
|
|
const str = this.loginType === 'TEACHER' ? 'teacher' : 'student'
|
|
|
this.qrCode = `${getCodeBaseUrl(`/${str}`)}/#/scanLogin?code=${
|
|
|
this.scanCode
|
|
@@ -62,12 +57,13 @@ export default defineComponent({
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async getCode() {
|
|
|
+ async getCode(code?: string) {
|
|
|
try {
|
|
|
const res = await request.get('/api-auth/getQRLoginCode', {
|
|
|
params: {
|
|
|
clientId: 'website',
|
|
|
- clientSecret: 'website'
|
|
|
+ clientSecret: 'website',
|
|
|
+ code
|
|
|
}
|
|
|
})
|
|
|
this.scanCode = res.data.code
|
|
@@ -185,7 +181,8 @@ export default defineComponent({
|
|
|
size="small"
|
|
|
onClick={async () => {
|
|
|
this.codeTimerOut = false
|
|
|
- await this.getCode()
|
|
|
+ const scanCode = sessionStorage.getItem('scanCode')
|
|
|
+ await this.getCode(scanCode)
|
|
|
state.loginPopupTimer = setInterval(async () => {
|
|
|
await this.getList()
|
|
|
}, 5000)
|