mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:43:26 +08:00
Merge branch 'dev' into 'master'
【优化】(获取用户信息):判断请求成功后,赋值 See merge request jianweie/coreshoppro!46
This commit is contained in:
@@ -82,8 +82,10 @@
|
|||||||
/** 获取用户信息 */
|
/** 获取用户信息 */
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
const userInfo : Response<UserInfoType> = await queryUserInfo();
|
const userInfo : Response<UserInfoType> = await queryUserInfo();
|
||||||
|
if(userInfo.status){
|
||||||
userInfoStore.setUserInfo(userInfo?.data);
|
userInfoStore.setUserInfo(userInfo?.data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 搜索 */
|
/** 搜索 */
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
|
|||||||
@@ -32,10 +32,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onPageScroll, onload } from '@dcloudio/uni-app';
|
import { onPageScroll, onLoad } from '@dcloudio/uni-app';
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { queryPageConfig, queryUserInfo } from '@/core/api';
|
import { queryPageConfig, queryUserInfo } from '@/core/api';
|
||||||
import type { Response, PageConfigType, PageConfigItemsType, UserInfoType, UserInfoStoreType } from '@/core/models';
|
import type { Response, PageConfigType, PageConfigItemsType, UserInfoType } from '@/core/models';
|
||||||
import CustomPage from '@/pages/components/custom-page/index.vue';
|
import CustomPage from '@/pages/components/custom-page/index.vue';
|
||||||
import HomeAdpop from '@/pages/components/custom-page/components/home-adpop/home-adpop.vue';
|
import HomeAdpop from '@/pages/components/custom-page/components/home-adpop/home-adpop.vue';
|
||||||
import { handleStaticResources } from '@/core/utils';
|
import { handleStaticResources } from '@/core/utils';
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
/** 获取自定义导航栏高度 */
|
/** 获取自定义导航栏高度 */
|
||||||
const { statusBarHeight } = useSystemInfo();
|
const { statusBarHeight } = useSystemInfo();
|
||||||
/** 获取 用户数据 */
|
/** 获取 用户数据 */
|
||||||
const userInfoStore : UserInfoStoreType = useUserInfoStore();
|
const userInfoStore = useUserInfoStore();
|
||||||
|
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
coreshopData : Array<PageConfigItemsType>;
|
coreshopData : Array<PageConfigItemsType>;
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onload((query : QueryParams) => {
|
onLoad((query : QueryParams) => {
|
||||||
getPageConfig(query?.code);
|
getPageConfig(query?.code);
|
||||||
if (uni.getStorageSync(UserToken)) {
|
if (uni.getStorageSync(UserToken)) {
|
||||||
getUserInfo();
|
getUserInfo();
|
||||||
@@ -83,8 +83,10 @@
|
|||||||
/** 获取用户信息 */
|
/** 获取用户信息 */
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
const userInfo : Response<UserInfoType> = await queryUserInfo();
|
const userInfo : Response<UserInfoType> = await queryUserInfo();
|
||||||
|
if(userInfo.status){
|
||||||
userInfoStore.setUserInfo(userInfo?.data);
|
userInfoStore.setUserInfo(userInfo?.data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user