master
xy 2 years ago
parent 36a87c8d82
commit a966e8ee0a

@ -4,3 +4,4 @@ ENV = 'development'
# base api
VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net
VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file
VUE_APP_AUTH_BASE_API = https://sso.szhct.edu.cn/cas/oauth2.0/authorize

@ -4,3 +4,4 @@ ENV = 'production'
# base api
VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net
VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file
VUE_APP_AUTH_BASE_API = https://sso.szhct.edu.cn/cas/oauth2.0/authorize

@ -19,7 +19,7 @@ router.beforeEach(async(to, from, next) => {
document.title = getPageTitle(to.meta.title)
if (/^\/index\/.*/.test(to.path)) {
setToken('31|wFxoNgXTLwNke7CCjfCyFYd3x4s9WG74VKpYyi8S','ReceptionTokenKey')
//setToken('31|wFxoNgXTLwNke7CCjfCyFYd3x4s9WG74VKpYyi8S','ReceptionTokenKey')
if (getToken('ReceptionTokenKey')) {
next()
@ -33,7 +33,7 @@ router.beforeEach(async(to, from, next) => {
})
} else {
let redirectUri = encodeURIComponent(window.location.href)
window.location.href = `https://sso.szhct.edu.cn/cas/oauth2.0/authorize?client_id=d05e4c9d07f705ef&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd`
window.location.href = `${process.env.VUE_APP_AUTH_BASE_API}?client_id=d05e4c9d07f705ef&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd`
}
}

Loading…
Cancel
Save