fix: 更新短信接口路径和登录参数命名
将短信接口路径从'/srv/?a=sms'改为'/srv/?a=sms_mas' 将登录相关参数从'phone'改为'mobile'以保持接口一致性
Showing
2 changed files
with
5 additions
and
5 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2022-06-17 14:54:29 | 2 | * @Date: 2022-06-17 14:54:29 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-11-11 09:19:52 | 4 | + * @LastEditTime: 2025-11-11 13:59:30 |
| 5 | * @FilePath: /stdj_h5/src/api/common.js | 5 | * @FilePath: /stdj_h5/src/api/common.js |
| 6 | * @Description: 通用接口 | 6 | * @Description: 通用接口 |
| 7 | */ | 7 | */ |
| 8 | import { fn, fetch, uploadFn } from '@/api/fn'; | 8 | import { fn, fetch, uploadFn } from '@/api/fn'; |
| 9 | 9 | ||
| 10 | const Api = { | 10 | const Api = { |
| 11 | - SMS: '/srv/?a=sms', | 11 | + SMS: '/srv/?a=sms_mas', |
| 12 | TOKEN: '/srv/?a=upload', | 12 | TOKEN: '/srv/?a=upload', |
| 13 | SAVE_FILE: '/srv/?a=upload&t=save_file', | 13 | SAVE_FILE: '/srv/?a=upload&t=save_file', |
| 14 | } | 14 | } | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-11-10 18:08:59 | 2 | * @Date: 2025-11-10 18:08:59 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-11-11 13:31:30 | 4 | + * @LastEditTime: 2025-11-11 14:01:40 |
| 5 | * @FilePath: /stdj_h5/src/views/Login.vue | 5 | * @FilePath: /stdj_h5/src/views/Login.vue |
| 6 | * @Description: 登录页 | 6 | * @Description: 登录页 |
| 7 | --> | 7 | --> |
| ... | @@ -150,7 +150,7 @@ const on_send_sms = async function () { | ... | @@ -150,7 +150,7 @@ const on_send_sms = async function () { |
| 150 | } | 150 | } |
| 151 | try { | 151 | try { |
| 152 | sending.value = true | 152 | sending.value = true |
| 153 | - const { code } = await smsAPI({ phone: phone.value }) | 153 | + const { code } = await smsAPI({ mobile: phone.value }) |
| 154 | if (code) { | 154 | if (code) { |
| 155 | showToast('验证码已发送') | 155 | showToast('验证码已发送') |
| 156 | start_countdown() | 156 | start_countdown() |
| ... | @@ -178,7 +178,7 @@ const on_login = async function () { | ... | @@ -178,7 +178,7 @@ const on_login = async function () { |
| 178 | } | 178 | } |
| 179 | try { | 179 | try { |
| 180 | logging.value = true | 180 | logging.value = true |
| 181 | - const { code, data } = await loginAPI({ phone: phone.value, code: code.value }) | 181 | + const { code, data } = await loginAPI({ mobile: phone.value, code: code.value }) |
| 182 | if (code) { | 182 | if (code) { |
| 183 | // 登录成功后,将token存储到cookie中 | 183 | // 登录成功后,将token存储到cookie中 |
| 184 | Cookies.set('token-stdj', data.token, { expires: 7 }) | 184 | Cookies.set('token-stdj', data.token, { expires: 7 }) | ... | ... |
-
Please register or login to post a comment