1 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9643],{87459:function(e,t,s){Promise.resolve().then(s.bind(s,94050))},2478:function(e,t,s){"use strict";s.d(t,{q5:function(){return y},AT:function(){return c},hu:function(){return b},m$:function(){return h},gu:function(){return u},z9:function(){return d},n3:function(){return p},bG:function(){return g},AA:function(){return v},gS:function(){return f},n$:function(){return x},ek:function(){return m}});var a=s(28535),r=s(41085),n=s(18963);let l=async e=>{if(!e.headers)return e;let t=e.headers.get("content-type"),s=e.headers.get("content-disposition");return null===t?null:-1!==t.indexOf("application/json")?await e.json():-1!==t.indexOf("text/plain")?await e.text():null!=s&&-1!==s.indexOf("attachment")?await e.blob():e},o=async e=>{let t=await l(e),s=(null==t?void 0:t.message)||(null==t?void 0:t.errMessage)||t;switch(e.status){case 500:s="内部服务器错误,请稍后再试";break;case 401:(0,n.rf)();return;case 403:s="资源拒绝授权访问",(0,n.d6)(1e3);break;case 404:return;default:s="string"==typeof s&&""!==s?s:"操作失败,请稍后再试,或联系技术人员"}throw a.ZP.error(s),t},i=()=>{let e=async(e,t,s)=>{let a=(0,r.kG)(),i="".concat(a).concat(e).concat((null==t?void 0:t.params)?t.params:""),c=(null==t?void 0:t.body)?t.body instanceof FormData?{...t,body:t.body}:{...t,body:JSON.stringify(t.body)}:t,d={...null==t?void 0:t.headers,...(null==t?void 0:t.body)&&t.body instanceof FormData?{}:{"Content-type":"application/json"},Authorization:"Bearer ".concat((0,n.cw)())};return fetch(i,{...c,headers:d,signal:s}).then(async e=>{if(!e.ok)throw e;return l(e)}).catch(async e=>{await o(e)})};return{get:async(t,s)=>e(t,{...s,method:"get"}),post:async(t,s)=>e(t,{...s,method:"post"}),put:async(t,s)=>e(t,{...s,method:"put"}),patch:async(t,s)=>e(t,{...s,method:"patch"}),delete:async(t,s)=>e(t,{...s,method:"delete"})}},c=e=>i().post("/category/list",{body:e}),d=e=>i().post("/employee/search",{body:e}),u=e=>i().post("/employee/detail",{body:e}),x=e=>i().post("/gpts/user/login",{body:e}),m=e=>i().post("/gpts/user/password",{body:e}),f=e=>i().post("/gpts/user/update",{body:e}),g=()=>i().post("/gpts/user/info"),p=()=>i().post("/gpts/user/balance"),b=e=>i().post("/gpts/chat/message",{body:e}),h=e=>i().post("/gpts/chat/session",{body:e}),y=e=>i().post("/gpts/chat/session/delete",{body:e}),v=e=>i().post("/gpts/chat/session/rename",{body:e})},94050:function(e,t,s){"use strict";s.r(t);var a=s(82267),r=s(38786),n=s(5292),l=s(28535),o=s(36989),i=s(2478),c=s(63501),d=s(41273);t.default=()=>{let e=(0,n.useRouter)();(0,d.useTheme)();let{changeMenuIndex:t,uploadUserInfoState:s,changeUploadUserInfoState:u}=(0,c.useGlobalContext)(),[x,m]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[p,b]=(0,r.useState)(""),[h,y]=(0,r.useState)(""),[v,w]=(0,r.useState)(""),[j,N]=(0,r.useState)(0),[k,S]=(0,r.useState)(""),[C,I]=(0,r.useState)(""),O=(0,r.useRef)(null),P=(0,r.useRef)(null),A=(0,r.useRef)(null),G=(0,r.useRef)(null),T=(0,r.useRef)(null);(0,r.useEffect)(()=>{t(0),(0,i.bG)().then(t=>{0==t.code?(m(t.data.username),g(t.data.nickname),b(t.data.nickname),y(t.data.mobile),w(t.data.email)):e.push("/")}),(0,i.n3)().then(e=>{0==e.code&&N(e.data.balance)})},[s]);let E=[{key:"1",label:"个人信息",children:(0,a.jsxs)("div",{className:"border border-gray-200 dark:border-slate-700 p-5 rounded-sm",children:[(0,a.jsx)("div",{className:"text-lg dark:text-white",children:"用户账户信息设置"}),(0,a.jsx)("div",{className:"py-5",children:(0,a.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)("div",{className:"flex w-full flex-col mx-auto sm:space-x-4 sm:space-y-0 space-y-4 sm:px-0 items-end",children:[(0,a.jsxs)("div",{className:"relative flex-grow w-full",children:[(0,a.jsx)("label",{className:"leading-7 text-sm text-gray-600 dark:text-gray-400",children:"昵称"}),(0,a.jsx)("input",{type:"text",autoComplete:"new-password",className:"w-full bg-gray-50 dark:bg-[#202123] bg-opacity-50 rounded border border-gray-300 dark:border-slate-700 focus:border-blue-950 focus:bg-transparent focus:ring-2 focus:ring-blue-950 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out",ref:O,value:p,onChange:e=>b(e.target.value)})]}),(0,a.jsxs)("div",{className:"relative flex-grow w-full",children:[(0,a.jsx)("label",{className:"leading-7 text-sm text-gray-600 dark:text-gray-400",children:"手机号码"}),(0,a.jsx)("input",{type:"phone",autoComplete:"new-password",className:"w-full bg-gray-50 dark:bg-[#202123] bg-opacity-50 rounded border border-gray-300 dark:border-slate-700 focus:border-blue-950 focus:bg-transparent focus:ring-2 focus:ring-blue-950 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out",ref:P,value:h,onChange:e=>y(e.target.value)})]}),(0,a.jsxs)("div",{className:"relative flex-grow w-full",children:[(0,a.jsx)("label",{className:"leading-7 text-sm text-gray-600 dark:text-gray-400",children:"邮箱"}),(0,a.jsx)("input",{type:"email",autoComplete:"new-password",className:"w-full bg-gray-50 dark:bg-[#202123] bg-opacity-50 rounded border border-gray-300 dark:border-slate-700 focus:border-blue-950 focus:bg-transparent focus:ring-2 focus:ring-blue-950 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out",ref:A,value:v,onChange:e=>w(e.target.value)})]}),(0,a.jsx)("div",{className:"relative flex-grow w-full pt-6 text-center",children:(0,a.jsx)("button",{className:"text-white global-bg-color border-0 py-2 px-12 focus:outline-none hover:bg-indigo-600 rounded-full",onClick:e=>{var t,a,r;e.preventDefault(),p?h?v?(0,i.gS)({nickname:p,mobile:h,email:v}).then(e=>{l.ZP.success("用户信息更新成功!"),u(!s)}):null===(t=A.current)||void 0===t||t.focus():null===(a=P.current)||void 0===a||a.focus():null===(r=O.current)||void 0===r||r.focus()},children:"保存"})})]})})})})]})},{key:"2",label:"账户安全",children:(0,a.jsxs)("div",{className:"border border-gray-200 dark:border-slate-700 p-5 rounded-sm",children:[(0,a.jsx)("div",{className:"text-lg dark:text-white",children:"用户账户信息设置"}),(0,a.jsx)("div",{className:"py-5",children:(0,a.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)("div",{className:"flex w-full flex-col mx-auto sm:space-x-4 sm:space-y-0 space-y-4 sm:px-0 items-end",children:[(0,a.jsxs)("div",{className:"relative flex-grow w-full",children:[(0,a.jsx)("label",{className:"leading-7 text-sm text-gray-600 dark:text-gray-400",children:"旧密码"}),(0,a.jsx)("input",{type:"password",autoComplete:"new-password",className:"w-full bg-gray-50 dark:bg-[#202123] bg-opacity-50 rounded border border-gray-300 dark:border-slate-700 focus:border-blue-950 focus:bg-transparent focus:ring-2 focus:ring-blue-950 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out",ref:G,value:k,onChange:e=>S(e.target.value)})]}),(0,a.jsxs)("div",{className:"relative flex-grow w-full",children:[(0,a.jsx)("label",{className:"leading-7 text-sm text-gray-600 dark:text-gray-400",children:"新密码"}),(0,a.jsx)("input",{type:"password",autoComplete:"new-password",className:"w-full bg-gray-50 dark:bg-[#202123] bg-opacity-50 rounded border border-gray-300 dark:border-slate-700 focus:border-blue-950 focus:bg-transparent focus:ring-2 focus:ring-blue-950 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out",ref:T,value:C,onChange:e=>I(e.target.value)})]}),(0,a.jsx)("div",{className:"relative flex-grow w-full pt-6 text-center",children:(0,a.jsx)("button",{className:"text-white global-bg-color border-0 py-2 px-12 focus:outline-none hover:bg-indigo-600 rounded-full",onClick:e=>{var t,s;e.preventDefault(),k?C?(0,i.ek)({password:k,password2:C}).then(e=>{l.ZP.success("密码更新成功"),S(""),I("")}):null===(t=T.current)||void 0===t||t.focus():null===(s=G.current)||void 0===s||s.focus()},children:"保存"})})]})})})})]})}];return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col md:flex-row p-5",children:[(0,a.jsxs)("div",{className:"w-full md:w-72 flex-none",children:[(0,a.jsxs)("h2",{className:"mb-4",children:[(0,a.jsx)("span",{className:"text-2xl text-[#0061ff]",children:"我的信息"}),(0,a.jsx)("span",{className:"text-sm text-red-700 float-right cursor-pointer bg-gray-200 px-3 py-2 rounded",onClick:()=>{localStorage.removeItem("chat-used-list-type"),localStorage.removeItem("chat-used-agent-id"),localStorage.removeItem("chat-used-conversation-id"),localStorage.removeItem("chat-model-list"),localStorage.removeItem("session"),l.ZP.success("账户退出成功!"),setTimeout(()=>{window.location.href="/"},600)},children:"退出登录"})]}),(0,a.jsxs)("div",{className:"text-center text-sm mt-10",children:[(0,a.jsx)("img",{className:"w-40 h-40 object-cover rounded mx-auto",src:"/images/avatar.png",alt:"avatar"}),(0,a.jsx)("div",{className:"mt-4 text-xl",children:f}),(0,a.jsx)("div",{className:"mt-3 text-gray-400",children:x}),(0,a.jsx)("div",{className:"mt-3 text-gray-600 text-left hidden",children:"我是一台基于深度学习和自然语言处理技术的 AI 机器人,旨在为用户提供高效、精准、个性化的智能服务。"})]}),(0,a.jsxs)("div",{className:"mt-10 text-sm hidden",children:[(0,a.jsx)("div",{className:"text-xl text-[#0061ff]",children:"我的成就"}),(0,a.jsxs)("div",{className:"mt-3 pl-3",children:[(0,a.jsx)("span",{className:"text-[#0061ff] pr-3",children:"基础模型使用:"}),j," 积分"]}),(0,a.jsxs)("div",{className:"mt-3 pl-3",children:[(0,a.jsx)("span",{className:"text-[#0061ff] pr-3",children:"高级模型使用:"}),"0 积分"]}),(0,a.jsxs)("div",{className:"mt-3 pl-3",children:[(0,a.jsx)("span",{className:"text-[#0061ff] pr-3",children:"基础模型使用:"}),"0 Token"]}),(0,a.jsxs)("div",{className:"mt-3 pl-3",children:[(0,a.jsx)("span",{className:"text-[#0061ff] pr-3",children:"高级模型使用:"}),"0 Token"]}),(0,a.jsxs)("div",{className:"mt-3 pl-3",children:[(0,a.jsx)("span",{className:"text-[#0061ff] pr-3",children:"专业绘画使用:"}),"0 积分"]})]})]}),(0,a.jsxs)("div",{className:"grow mt-10 md:mt-0 md:pl-16",children:[(0,a.jsxs)("div",{className:"border-b border-gray-200 dark:border-slate-700 pb-5",children:[(0,a.jsx)("h2",{className:"text-xl font-bold",children:"个人中心"}),(0,a.jsx)("div",{className:"text-sm mt-3 dark:text-gray-400 hidden",children:"编辑个人信息、查看更多详情"})]}),(0,a.jsx)("div",{className:"mt-6",children:(0,a.jsx)(o.Z,{defaultActiveKey:"1",items:E})})]})]})})}},63501:function(e,t,s){"use strict";s.r(t),s.d(t,{GlobalProvider:function(){return l},useGlobalContext:function(){return o}});var a=s(82267),r=s(38786);let n=(0,r.createContext)(null),l=e=>{let{children:t}=e,[s,l]=(0,r.useState)(0),[o,i]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{},[]),(0,a.jsx)(n.Provider,{value:{menuIndex:s,changeMenuIndex:e=>{l(e)},loginShow:o,changeLoginShow:e=>{i(e)},uploadUserInfoState:c,changeUploadUserInfoState:e=>{d(e)}},children:t})},o=()=>(0,r.useContext)(n)},41085:function(e,t,s){"use strict";s.d(t,{kG:function(){return r},tq:function(){return a}});let a=()=>{let e=void 0===window.navigator?"":navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(e)},r=()=>"https://wxadminapi.gkscrm.com/wechat-api"},18963:function(e,t,s){"use strict";s.d(t,{Sm:function(){return l},cw:function(){return o},d6:function(){return n},rf:function(){return r}});let a=()=>"/login",r=()=>{location.href=a()},n=e=>{let t=()=>{location.href="/"};e?setTimeout(t,e):t()},l=(e,t)=>{localStorage.setItem("session",JSON.stringify({sessionId:e,expires:t}))},o=()=>{if("undefined"==typeof localStorage)return"";let e=JSON.parse(localStorage.getItem("session")||"{}");return(null==e?void 0:e.expires)&&(null==e?void 0:e.expires)>new Date().getTime()?e.sessionId:""}}},function(e){e.O(0,[9791,3402,4241,3463,7717,1744],function(){return e(e.s=87459)}),_N_E=e.O()}]);
|