使用JWT

时间:2017-08-31 14:03:36

标签: c# jwt

我从cookie中收到了这种字符串,我想要序列化它并想要LoggedInId。 帮助将不胜感激。 %7B%22Identity%22%3A%22nFBaiV3RT09D8up2YUNdkQ%3D%3D%22%2C%22LoggedInId%22%3A16%2C%22AgencyId%22%3A0%2C%22Email%22%3A%22pratik%40universal-software.com%22%2C%22FirstName%22%3A%22Pratik%22%2C%22LastName%22%3A%22Patel%22%2C%22ImageUrl%22%3A%22%22%2C%22UserTypeId%22%3A16%7D

1 个答案:

答案 0 :(得分:1)

您应该通过url解码器(例如HttpUtility)对其进行解码,之后您可以通过例如Json.net将其反序列化为类:

import VueRouter from 'vue-router';
import Home from './views/home.vue'
import About from './views/about.vue'

let routes = [
    {
        path: '/',
        component: Home
    },
    {
        path: '/about',
        component: About
    }
];

export default new VueRouter({
    routes
});