import { ssoAuth, authUser } from '../api/index';
// import constants from '../utils/constants';
import cache from '../plugins/cache';
export const errorList = [
    {
        name: "格式问题",
        code: "1",
    },
    {
        name: "逻辑问题",
        code: "2",
    },
    {
        name: "有害信息",
        code: "3",
    },
    {
        name: "事实错误",
        code: "4",
    },
    {
        name: "没有帮助",
        code: "5",
    },
    {
        name: "答非所问",
        code: "6",
    },
]

// export const getUserInfo = async (token) => {
//     const ssoRes = await ssoAuth(token);
//     const userRes = await authUser({
//         'X-Auth-User': encodeURIComponent(ssoRes.name),
//         'X-Auth-Token': ssoRes.password,
//         'X-Enterprise-Id': `${constants['X-Enterprise-Id']}`,
//         'X-App-Id': `${constants['X-App-Id']}`,
//         'X-App-Secret': `${constants['X-App-Secret']}`,
//         'X-Auth-User-Type': '1',
//     });
//     cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
// }
export const getUserInfo = async (token, businessSource) => {
    await ssoAuth(token, businessSource);
    cache.session.setJSON('SRKJ_TOKEN_CACHE', token);
}