|
@@ -7,6 +7,7 @@ import { removeAuth, setAuth } from './utils'
|
|
|
import styles from './index.module.less'
|
|
|
import request from '@/helpers/request'
|
|
|
import { browser, getUrlCode } from '@/helpers/utils'
|
|
|
+import qs from 'query-string'
|
|
|
|
|
|
type loginType = 'PWD' | 'SMS'
|
|
|
export default defineComponent({
|
|
@@ -81,13 +82,35 @@ export default defineComponent({
|
|
|
},
|
|
|
'jump pre registration'
|
|
|
)
|
|
|
- this.$router.replace({
|
|
|
- path: returnUrl as any,
|
|
|
- query: {
|
|
|
+ // console.log(returnUrl, isRegister, { ...rest })
|
|
|
+ // this.$router.replace({
|
|
|
+ // path: returnUrl as any,
|
|
|
+ // query: {
|
|
|
+ // ...rest,
|
|
|
+ // code: this.code
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ const newUrl =
|
|
|
+ window.location.origin +
|
|
|
+ window.location.pathname +
|
|
|
+ '#' +
|
|
|
+ returnUrl +
|
|
|
+ '?' +
|
|
|
+ qs.stringify({
|
|
|
...rest,
|
|
|
code: this.code
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ this.locationReplace(newUrl)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ locationReplace(url: any) {
|
|
|
+ // 只允许同域名
|
|
|
+ console.log(history.replaceState, 'window.history.replaceState')
|
|
|
+ if (history.replaceState) {
|
|
|
+ history.replaceState(null, document.title, url)
|
|
|
+ history.go(0)
|
|
|
+ } else {
|
|
|
+ location.replace(url)
|
|
|
}
|
|
|
},
|
|
|
async onLogin() {
|