diff --git a/.env.development b/.env.development index 7bf5903..753c18e 100644 --- a/.env.development +++ b/.env.development @@ -7,6 +7,7 @@ VITE_APP_PORT = 4096 VITE_APP_BASE_API = '/dev-api' # API 服务器的 URL -VITE_APP_API_URL = https://api.youlai.tech +VITE_APP_API_URL = http://localhost:8989 -VITE_APP_WS_ENDPOINT= ws://localhost:4096/ws \ No newline at end of file +# WebSocket 服务器的 URL,不配置默认关闭 WebSocket +#VITE_APP_WS_ENDPOINT= ws://localhost:4096/ws \ No newline at end of file diff --git a/components.d.ts b/components.d.ts index b62069f..d65e7a9 100644 --- a/components.d.ts +++ b/components.d.ts @@ -19,16 +19,13 @@ declare module 'vue' { QiunDataCharts: typeof import('./src/components/qiun-data-charts/qiun-data-charts.vue')['default'] QiunError: typeof import('./src/components/qiun-error/qiun-error.vue')['default'] QiunLoading: typeof import('./src/components/qiun-loading/qiun-loading.vue')['default'] - TodoItem: (typeof import("./src/components/todo/TodoItem.vue"))["default"] - TodoList: (typeof import("./src/components/todo/TodoList.vue"))["default"] WdButton: typeof import('wot-design-uni/components/wd-button/wd-button.vue')['default'] WdCard: typeof import('wot-design-uni/components/wd-card/wd-card.vue')['default'] WdCell: typeof import('wot-design-uni/components/wd-cell/wd-cell.vue')['default'] WdCellGroup: typeof import('wot-design-uni/components/wd-cell-group/wd-cell-group.vue')['default'] - WdCollapse: (typeof import("wot-design-uni/components/wd-collapse/wd-collapse.vue"))["default"] - WdCollapseItem: (typeof import("wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue"))["default"] + WdCollapse: typeof import('wot-design-uni/components/wd-collapse/wd-collapse.vue')['default'] + WdCollapseItem: typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue')['default'] WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default'] - WdDivider: (typeof import("wot-design-uni/components/wd-divider/wd-divider.vue"))["default"] WdForm: typeof import('wot-design-uni/components/wd-form/wd-form.vue')['default'] WdGrid: typeof import('wot-design-uni/components/wd-grid/wd-grid.vue')['default'] WdGridItem: typeof import('wot-design-uni/components/wd-grid-item/wd-grid-item.vue')['default'] @@ -37,7 +34,6 @@ declare module 'vue' { WdImgCropper: typeof import('wot-design-uni/components/wd-img-cropper/wd-img-cropper.vue')['default'] WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default'] WdMessageBox: typeof import('wot-design-uni/components/wd-message-box/wd-message-box.vue')['default'] - WdNavbar: typeof import('wot-design-uni/components/wd-navbar/wd-navbar.vue')['default'] WdNoticeBar: typeof import('wot-design-uni/components/wd-notice-bar/wd-notice-bar.vue')['default'] WdNotify: typeof import('wot-design-uni/components/wd-notify/wd-notify.vue')['default'] WdPopup: typeof import('wot-design-uni/components/wd-popup/wd-popup.vue')['default'] @@ -48,7 +44,9 @@ declare module 'vue' { WdTabbar: typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue')['default'] WdTabbarItem: typeof import('wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.vue')['default'] WdTag: typeof import('wot-design-uni/components/wd-tag/wd-tag.vue')['default'] + WdTextarea: typeof import('wot-design-uni/components/wd-textarea/wd-textarea.vue')['default'] WdToast: typeof import('wot-design-uni/components/wd-toast/wd-toast.vue')['default'] + WdUpload: typeof import('wot-design-uni/components/wd-upload/wd-upload.vue')['default'] WechatProfile: typeof import('./src/components/business/WechatProfile.vue')['default'] } } diff --git a/src/api/auth.ts b/src/api/auth.ts index 799bed8..86e88ce 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -30,10 +30,18 @@ const AuthAPI = { * @returns 登录结果 */ login(data: LoginData): Promise { + const formData = { + username: data.username, + password: data.password, + }; + return request({ url: `${AUTH_BASE_URL}/login`, method: "POST", - data, + data: formData, + header: { + "Content-Type": "application/x-www-form-urlencoded", + }, }); }, @@ -42,7 +50,7 @@ const AuthAPI = { * @param code 微信登录凭证 * @returns 登录结果 */ - wechatLogin(code: string): Promise { + loginByWxMiniAppCode(code: string): Promise { return request({ url: `${AUTH_BASE_URL}/wx/miniapp/code-login`, method: "POST", @@ -55,7 +63,7 @@ const AuthAPI = { * @param data 包含code、encryptedData、iv等手机号相关数据 * @returns 登录结果 */ - wechatPhoneLogin(data: WxLoginData): Promise { + loginByWxMiniAppPhone(data: WxLoginData): Promise { return request({ url: `${AUTH_BASE_URL}/wx/miniapp/phone-login`, method: "POST", diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 18d3e07..9dd6be9 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -1,57 +1,7 @@