Commit 081427b3 by cocomilk2012

update

parent 9aee35cb
...@@ -97,8 +97,6 @@ function getPathByTo(to, authcode_key) { ...@@ -97,8 +97,6 @@ function getPathByTo(to, authcode_key) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log('开始路由');
console.log('to.fullpath=', to.fullPath);
if (isOpenHttps === 'true' && location.href.startsWith('http://')) { if (isOpenHttps === 'true' && location.href.startsWith('http://')) {
location.href = location.href.replace('http://', 'https://'); location.href = location.href.replace('http://', 'https://');
} }
...@@ -110,18 +108,13 @@ router.beforeEach((to, from, next) => { ...@@ -110,18 +108,13 @@ router.beforeEach((to, from, next) => {
const authcode = to.query.authCode || to.query.authcode; const authcode = to.query.authCode || to.query.authcode;
console.log('authcode=', authcode);
if (!!authcode) { if (!!authcode) {
getAccessToken(authcode) getAccessToken(authcode)
.then((res) => { .then((res) => {
const redirectPath = getPathByTo(to, 'authcode'); const redirectPath = getPathByTo(to, 'authcode');
console.log('redirectPath=', redirectPath);
//@ts-ignore //@ts-ignore
const accessToken: string = res; const accessToken: string = res;
localStorage.setItem('token', accessToken); localStorage.setItem('token', accessToken);
console.log('redirectPath=', redirectPath);
window.location.href = redirectPath; window.location.href = redirectPath;
}) })
.catch((err) => { .catch((err) => {
......
...@@ -84,6 +84,7 @@ export default class SelectIdentity extends Vue { ...@@ -84,6 +84,7 @@ export default class SelectIdentity extends Vue {
.then(res => { .then(res => {
if (res.data && res.data.uthStatus && res.data.uthStatus > 0) { if (res.data && res.data.uthStatus && res.data.uthStatus > 0) {
this.id_no = res.data.personalIdCardNo; this.id_no = res.data.personalIdCardNo;
localStorage.setItem("id_no", res.data.personalIdCardNo);
localStorage.setItem("name", res.data.personalName); localStorage.setItem("name", res.data.personalName);
localStorage.setItem("birthday", res.data.birthday); localStorage.setItem("birthday", res.data.birthday);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment