玩转Vben Admin第4改:注册页面功能实现 复制原有的登录功能,如此一来,注册后就能够自动登录系统。 第一步:修改 /src/api/sys/user.ts 添加接口提交代码 /** * @description: user register api*/exportfunctionregisterApi(params: LoginParams, mode: ErrorMessageMode = 'modal') {returndefHttp.post<LoginR...
:(res:AxiosResponse<Result>,options:RequestOptions)=>any;/** * @description: 请求失败处理 */requestCatch?:(e:Error)=>Promise<any>;/** * @description: 请求之前的拦截器 */requestInterceptors?:(config:AxiosRequestConfig)=>AxiosRequestConfig;/** * @description: 请求之后的拦截器 */response...
form: fix validate promise catch (571f281) img-rotate-drag-verify: fix resume method support (32d64db), closes #946 login: fix auto fill style in dark-theme (cebc6a5) perm-guard: Fix the problem that the routing query is lost after refreshing the page (#941) (9c4889f) qrcode: Fi...
: Recordable; # Check editRule?: boolean | ((text: string, record: Recordable) => Promise<string>); # Value enumeration conversion editValueMap?: (value: any) => string; # Trigger editing Zhenghang record.onEditRow?: () => void; } ✨ Table reconstruction Added clickToRowSelect ...
asyncbuildRoutesAction():Promise<AppRouteRecordRaw[]> {const{ t } =useI18n();// 国际化constuserStore =useUserStore();// 用户信息存储constappStore =useAppStoreWithOut();// 项目配置信息存储letroutes:AppRouteRecordRaw[] = [];// 用户角色列表constroleList =toRaw(userStore.getRoleList) || ...
return resultSuccess(codeList); }, }, const fakeCodeList: any = { '1': ['1000', '3000', '5000'], '2': ['2000', '4000', '6000'], }; 动态路由&权限过滤 方法buildRoutesAction用于动态路由及用户权限过滤,代码逻辑结构如下: async buildRoutesAction(): Promise<AppRouteRecordRaw[]> { ...
137 + return new Promise<T>((resolve, reject) => { 138 + this.axiosInstance 139 + .request<T, AxiosResponse<Result<T>>>({ 140 + ...config, 141 + method: 'POST', 142 + data: formData, 143 + headers: { 144 + 'Content-type': ContentTypeEnum.FORM_DATA 145 + } ...
): Promise<T> { const loading: Ora = ora(title).start(); try { const result = await callback(); loading.succeed(successText || 'Success!'); return result; } catch (error) { loading.fail(failedText || 'Failed!'); throw error; } finally { loading.stop(); } } 1 change: 0 ...
asyncbuildRoutesAction():Promise<AppRouteRecordRaw[]>{const{t}=useI18n();// 国际化constuserStore=useUserStore();// 用户信息存储constappStore=useAppStoreWithOut();// 项目配置信息存储letroutes:AppRouteRecordRaw[]=[];// 用户角色列表constroleList=toRaw(userStore.getRoleList)||[];// 获取权限...
): Promise<GetUserInfoModel | null> { try { const { goHome = true, mode, ...registerParams } = params; const data = await registerApi(registerParams, mode); const { token } = data; // save token this.setToken(token); return this.afterLoginAction(goHome); ...