mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:53:25 +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 userInfo : Response<UserInfoType> = await queryUserInfo();
|
||||
if(userInfo.status){
|
||||
userInfoStore.setUserInfo(userInfo?.data);
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索 */
|
||||
const handleSearch = () => {
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onPageScroll, onload } from '@dcloudio/uni-app';
|
||||
import { onPageScroll, onLoad } from '@dcloudio/uni-app';
|
||||
import { reactive } from 'vue';
|
||||
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 HomeAdpop from '@/pages/components/custom-page/components/home-adpop/home-adpop.vue';
|
||||
import { handleStaticResources } from '@/core/utils';
|
||||
@@ -50,7 +50,7 @@
|
||||
/** 获取自定义导航栏高度 */
|
||||
const { statusBarHeight } = useSystemInfo();
|
||||
/** 获取 用户数据 */
|
||||
const userInfoStore : UserInfoStoreType = useUserInfoStore();
|
||||
const userInfoStore = useUserInfoStore();
|
||||
|
||||
const state = reactive<{
|
||||
coreshopData : Array<PageConfigItemsType>;
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
})
|
||||
|
||||
onload((query : QueryParams) => {
|
||||
onLoad((query : QueryParams) => {
|
||||
getPageConfig(query?.code);
|
||||
if (uni.getStorageSync(UserToken)) {
|
||||
getUserInfo();
|
||||
@@ -83,8 +83,10 @@
|
||||
/** 获取用户信息 */
|
||||
const getUserInfo = async () => {
|
||||
const userInfo : Response<UserInfoType> = await queryUserInfo();
|
||||
if(userInfo.status){
|
||||
userInfoStore.setUserInfo(userInfo?.data);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user