update:传递用户token给SPDM
This commit is contained in:
@@ -7,6 +7,11 @@
|
|||||||
:degrade="false"
|
:degrade="false"
|
||||||
:alive="false"
|
:alive="false"
|
||||||
:preload="true"
|
:preload="true"
|
||||||
|
:props="{
|
||||||
|
TENANT_ID,
|
||||||
|
TOKEN,
|
||||||
|
USER_ID
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -14,9 +19,13 @@
|
|||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import WujieVue from "wujie-vue3";
|
import WujieVue from "wujie-vue3";
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
|
|
||||||
// const SPDM_URL = 'http://192.168.65.64:3001';
|
// const SPDM_URL = 'http://192.168.65.64:3001';
|
||||||
const SPDM_URL = 'http://192.168.65.161:80';
|
const SPDM_URL = 'http://192.168.65.161:80';
|
||||||
|
const USER_ID = Cookies.get('cid_user_id');
|
||||||
|
const TENANT_ID = Cookies.get('cid_tenant_id');
|
||||||
|
const TOKEN = Cookies.get('cid_token');
|
||||||
|
|
||||||
const { bus } = WujieVue;
|
const { bus } = WujieVue;
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {getUserInfo, login, loginByMobile, loginBySocial, refreshTokenApi, tenan
|
|||||||
import {useMessage} from '/@/hooks/message';
|
import {useMessage} from '/@/hooks/message';
|
||||||
import {avatarFormat} from '/@/utils/commonFunction';
|
import {avatarFormat} from '/@/utils/commonFunction';
|
||||||
import {ITenant} from '/@/api/admin/tenant';
|
import {ITenant} from '/@/api/admin/tenant';
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function useUserInfo
|
* @function useUserInfo
|
||||||
@@ -55,6 +56,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
login(data)
|
login(data)
|
||||||
.then(({data: res}) => {
|
.then(({data: res}) => {
|
||||||
|
Cookies.set('cid_user_id', res.user_id)
|
||||||
Session.setTenant(res.tenant_id);
|
Session.setTenant(res.tenant_id);
|
||||||
// 存储token 信息
|
// 存储token 信息
|
||||||
Token.set(res.access_token);
|
Token.set(res.access_token);
|
||||||
|
|||||||
Reference in New Issue
Block a user