|
@@ -63,6 +63,7 @@ const props = defineProps({
|
|
|
project: Object,
|
|
|
showAdjust: Boolean,
|
|
|
})
|
|
|
+const projectId = browser.valueFromUrl('projectId') || ''
|
|
|
const emits = defineEmits(['update', 'getUserId'])
|
|
|
const isLogin = inject('isLogin')
|
|
|
const isAuth = inject('isAuth')
|
|
@@ -132,7 +133,7 @@ const onSetP2 = () => {
|
|
|
emits('update', 'p2', points.value.p2)
|
|
|
}
|
|
|
const getAuth = () => {
|
|
|
- http.post(`smart-site/validatedProject/${props.project.projectId}`)
|
|
|
+ http.post(`smart-site/validatedProject/${projectId}`)
|
|
|
.then(res => {
|
|
|
if (res.code == 0) {
|
|
|
isAuth.value = true
|
|
@@ -147,13 +148,13 @@ const getUserInfo = () => {
|
|
|
http.post(`smart-site/getUserInfo`)
|
|
|
.then(response => {
|
|
|
if (response.success) {
|
|
|
- getAuth()
|
|
|
user.value = {
|
|
|
head: response.data.head,
|
|
|
nickName: response.data.nickName,
|
|
|
}
|
|
|
localStorage.setItem('userId', response.data.id)
|
|
|
isLogin.value = true
|
|
|
+ getAuth()
|
|
|
} else {
|
|
|
if (response.code == 4008) {
|
|
|
// 未登录
|