|
|
@@ -3,8 +3,24 @@ import { ref, reactive } from "vue"; |
|
|
|
export const userInfoModules = defineStore("userInfoStore", () => {
|
|
|
|
// state
|
|
|
|
const userInfo = ref(null)
|
|
|
|
const equipment = ref(null) //平台 : web、mp-weixin、mp-toutiao
|
|
|
|
const mySystem = ref(null) //安卓和ios : ios、android、windows、macos
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description:依托平台:(web、mp-weixin、mp-toutiao)
|
|
|
|
* @example 平台名:web-H5,枚举值:1
|
|
|
|
* @example 平台名:mp-weixin,枚举值:2
|
|
|
|
* @example 平台名:mp-toutiao,枚举值:3
|
|
|
|
*/
|
|
|
|
const platForm = ref(null)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description:宿主系统:(windows、ios、android、mac、linux)
|
|
|
|
* @example 系统名:windows,值:1
|
|
|
|
* @example 系统名:ios,值:2
|
|
|
|
* @example 系统名:android,值:3
|
|
|
|
* @example 系统名:mac,值:4
|
|
|
|
* @example 系统名:linux,值:5
|
|
|
|
*/
|
|
|
|
const hostSystem = ref(null)
|
|
|
|
|
|
|
|
// 登录获取用户信息
|
|
|
|
async function getUserInfo() {
|
|
|
@@ -14,7 +30,7 @@ export const userInfoModules = defineStore("userInfoStore", () => { |
|
|
|
function loginOut(params) {
|
|
|
|
|
|
|
|
}
|
|
|
|
return { userInfo, equipment, mySystem, getUserInfo, loginOut };
|
|
|
|
return { userInfo, platForm, hostSystem, getUserInfo, loginOut };
|
|
|
|
},
|
|
|
|
{
|
|
|
|
persist: true,
|