feat(收款设置): 将银行字段从名称改为ID并添加银行列表接口
修改用户信息中的银行字段从名称(bank)改为ID(bank_id) 添加获取银行列表接口并在收款设置页面使用 更新相关权限检查和字段验证逻辑
Showing
7 changed files
with
63 additions
and
75 deletions
| ... | @@ -37,7 +37,7 @@ export const payCheckAPI = (params) => fn(fetch.post(Api.PAY_CHECK, params)); | ... | @@ -37,7 +37,7 @@ export const payCheckAPI = (params) => fn(fetch.post(Api.PAY_CHECK, params)); |
| 37 | * @param sms_code 短信验证码 | 37 | * @param sms_code 短信验证码 |
| 38 | * @param school_id 学校id | 38 | * @param school_id 学校id |
| 39 | * @param name 真实姓名 | 39 | * @param name 真实姓名 |
| 40 | - * @param bank 开户行 | 40 | + * @param bank_id 开户行id |
| 41 | * @param bank_no 银行卡号 | 41 | * @param bank_no 银行卡号 |
| 42 | * @param idcard 身份证号 | 42 | * @param idcard 身份证号 |
| 43 | * @param is_signed 是否阅读协议 | 43 | * @param is_signed 是否阅读协议 | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-07-10 16:13:08 | 2 | * @Date: 2025-07-10 16:13:08 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-14 19:45:14 | 4 | + * @LastEditTime: 2025-08-06 17:34:27 |
| 5 | * @FilePath: /jgdl/src/api/other.js | 5 | * @FilePath: /jgdl/src/api/other.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -12,6 +12,7 @@ const Api = { | ... | @@ -12,6 +12,7 @@ const Api = { |
| 12 | GET_BRANDS_MODELS: '/srv/?a=common&t=get_brands_models', | 12 | GET_BRANDS_MODELS: '/srv/?a=common&t=get_brands_models', |
| 13 | GET_VEHICLE_BRANDS: '/srv/?a=common&t=get_vehicle_brands', | 13 | GET_VEHICLE_BRANDS: '/srv/?a=common&t=get_vehicle_brands', |
| 14 | GET_VERIFICATION_PRICE: '/srv/?a=common&t=get_verification_price', | 14 | GET_VERIFICATION_PRICE: '/srv/?a=common&t=get_verification_price', |
| 15 | + GET_BANKS: '/srv/?a=common&t=get_banks', | ||
| 15 | SUBMIT_FEEDBACK: '/srv/?a=feedback&t=add', | 16 | SUBMIT_FEEDBACK: '/srv/?a=feedback&t=add', |
| 16 | GET_FEEDBACK_LIST: '/srv/?a=feedback&t=list', | 17 | GET_FEEDBACK_LIST: '/srv/?a=feedback&t=list', |
| 17 | GET_FAVORITE_LIST: '/srv/?a=favorite&t=list', | 18 | GET_FAVORITE_LIST: '/srv/?a=favorite&t=list', |
| ... | @@ -83,3 +84,11 @@ export const getFeedbackListAPI = (params) => fn(fetch.get(Api.GET_FEEDBACK_LIST | ... | @@ -83,3 +84,11 @@ export const getFeedbackListAPI = (params) => fn(fetch.get(Api.GET_FEEDBACK_LIST |
| 83 | * @returns | 84 | * @returns |
| 84 | */ | 85 | */ |
| 85 | export const submitFeedbackAPI = (params) => fn(fetch.post(Api.SUBMIT_FEEDBACK, params)); | 86 | export const submitFeedbackAPI = (params) => fn(fetch.post(Api.SUBMIT_FEEDBACK, params)); |
| 87 | + | ||
| 88 | +/** | ||
| 89 | + * @description: 获取银行列表 | ||
| 90 | + * @param {*} params | ||
| 91 | + * @param {string} params.data[{ id, name }] - 银行列表 | ||
| 92 | + * @returns | ||
| 93 | + */ | ||
| 94 | +export const getBanksAPI = (params) => fn(fetch.get(Api.GET_BANKS, params)); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-06 12:40:14 | 4 | + * @LastEditTime: 2025-08-06 17:43:18 |
| 5 | * @FilePath: /jgdl/src/pages/collectionSettings/index.vue | 5 | * @FilePath: /jgdl/src/pages/collectionSettings/index.vue |
| 6 | * @Description: 收款设置 | 6 | * @Description: 收款设置 |
| 7 | --> | 7 | --> |
| ... | @@ -58,7 +58,7 @@ | ... | @@ -58,7 +58,7 @@ |
| 58 | <text class="form-label">银行名称</text> | 58 | <text class="form-label">银行名称</text> |
| 59 | <view class="bank-selector" @click="showBankPicker"> | 59 | <view class="bank-selector" @click="showBankPicker"> |
| 60 | <text class="bank-text" :class="{ 'bank-selected': tempAccountInfo.bankName }"> | 60 | <text class="bank-text" :class="{ 'bank-selected': tempAccountInfo.bankName }"> |
| 61 | - {{ tempAccountInfo.bankName || '请选择银行' }} | 61 | + {{ getBankNameById(tempAccountInfo.bankName) || '请选择银行' }} |
| 62 | </text> | 62 | </text> |
| 63 | <text class="arrow-down">></text> | 63 | <text class="arrow-down">></text> |
| 64 | </view> | 64 | </view> |
| ... | @@ -186,6 +186,8 @@ import "./index.less"; | ... | @@ -186,6 +186,8 @@ import "./index.less"; |
| 186 | 186 | ||
| 187 | // 导入接口 | 187 | // 导入接口 |
| 188 | import { updateProfileAPI, getProfileAPI } from '@/api/index' | 188 | import { updateProfileAPI, getProfileAPI } from '@/api/index' |
| 189 | +import { getBanksAPI } from '@/api/other' | ||
| 190 | + | ||
| 189 | // 导入用户状态管理 | 191 | // 导入用户状态管理 |
| 190 | import { useUserStore } from '@/stores/user' | 192 | import { useUserStore } from '@/stores/user' |
| 191 | 193 | ||
| ... | @@ -252,27 +254,27 @@ const idCardError = ref(''); | ... | @@ -252,27 +254,27 @@ const idCardError = ref(''); |
| 252 | const bankPickerValue = ref([]); | 254 | const bankPickerValue = ref([]); |
| 253 | 255 | ||
| 254 | /** | 256 | /** |
| 255 | - * 银行列表数据(模拟数据,后期从接口获取) | 257 | + * 银行列表数据(从接口获取) |
| 256 | */ | 258 | */ |
| 257 | -const bankOptions = ref([ | 259 | +const bankOptions = ref([]); |
| 258 | - { text: '中国工商银行', value: '中国工商银行' }, | ||
| 259 | - { text: '中国建设银行', value: '中国建设银行' }, | ||
| 260 | - { text: '中国农业银行', value: '中国农业银行' }, | ||
| 261 | - { text: '中国银行', value: '中国银行' }, | ||
| 262 | - { text: '交通银行', value: '交通银行' }, | ||
| 263 | - { text: '招商银行', value: '招商银行' }, | ||
| 264 | - { text: '中信银行', value: '中信银行' }, | ||
| 265 | - { text: '光大银行', value: '光大银行' }, | ||
| 266 | - { text: '华夏银行', value: '华夏银行' }, | ||
| 267 | - { text: '民生银行', value: '民生银行' }, | ||
| 268 | - { text: '广发银行', value: '广发银行' }, | ||
| 269 | - { text: '平安银行', value: '平安银行' }, | ||
| 270 | - { text: '浦发银行', value: '浦发银行' }, | ||
| 271 | - { text: '兴业银行', value: '兴业银行' }, | ||
| 272 | - { text: '邮储银行', value: '邮储银行' } | ||
| 273 | -]); | ||
| 274 | - | ||
| 275 | 260 | ||
| 261 | +/** | ||
| 262 | + * 获取银行列表 | ||
| 263 | + */ | ||
| 264 | +const getBanksList = async () => { | ||
| 265 | + try { | ||
| 266 | + const result = await getBanksAPI(); | ||
| 267 | + if (result.code && result.data) { | ||
| 268 | + // 适配数据格式:将 {id, name} 转换为 {text: name, value: id} | ||
| 269 | + bankOptions.value = result.data.map(bank => ({ | ||
| 270 | + text: bank.name, | ||
| 271 | + value: bank.id | ||
| 272 | + })); | ||
| 273 | + } | ||
| 274 | + } catch (error) { | ||
| 275 | + console.error('获取银行列表失败:', error); | ||
| 276 | + } | ||
| 277 | +}; | ||
| 276 | 278 | ||
| 277 | /** | 279 | /** |
| 278 | * 获取用户信息 | 280 | * 获取用户信息 |
| ... | @@ -284,9 +286,9 @@ const getUserInfo = async () => { | ... | @@ -284,9 +286,9 @@ const getUserInfo = async () => { |
| 284 | const userInfo = result.data; | 286 | const userInfo = result.data; |
| 285 | 287 | ||
| 286 | // 设置收款账号信息 | 288 | // 设置收款账号信息 |
| 287 | - if (userInfo.bank && userInfo.bank_no) { | 289 | + if (userInfo.bank_id && userInfo.bank_no) { |
| 288 | accountInfo.value = { | 290 | accountInfo.value = { |
| 289 | - bankName: userInfo.bank, | 291 | + bankName: userInfo.bank_id, // 存储银行ID |
| 290 | bankAccount: userInfo.bank_no | 292 | bankAccount: userInfo.bank_no |
| 291 | }; | 293 | }; |
| 292 | } | 294 | } |
| ... | @@ -305,9 +307,10 @@ const getUserInfo = async () => { | ... | @@ -305,9 +307,10 @@ const getUserInfo = async () => { |
| 305 | }; | 307 | }; |
| 306 | 308 | ||
| 307 | /** | 309 | /** |
| 308 | - * 页面加载时获取用户信息 | 310 | + * 页面加载时获取数据 |
| 309 | */ | 311 | */ |
| 310 | onMounted(() => { | 312 | onMounted(() => { |
| 313 | + getBanksList(); | ||
| 311 | getUserInfo(); | 314 | getUserInfo(); |
| 312 | }); | 315 | }); |
| 313 | 316 | ||
| ... | @@ -361,13 +364,24 @@ const handleIdCardBlur = () => { | ... | @@ -361,13 +364,24 @@ const handleIdCardBlur = () => { |
| 361 | }; | 364 | }; |
| 362 | 365 | ||
| 363 | /** | 366 | /** |
| 367 | + * 根据银行ID获取银行名称 | ||
| 368 | + * @param {string} bankId - 银行ID | ||
| 369 | + * @returns {string} - 银行名称 | ||
| 370 | + */ | ||
| 371 | +const getBankNameById = (bankId) => { | ||
| 372 | + if (!bankId || !bankOptions.value.length) return ''; | ||
| 373 | + const bank = bankOptions.value.find(item => item.value === bankId); | ||
| 374 | + return bank ? bank.text : bankId; | ||
| 375 | +}; | ||
| 376 | + | ||
| 377 | +/** | ||
| 364 | * 显示银行选择弹窗 | 378 | * 显示银行选择弹窗 |
| 365 | */ | 379 | */ |
| 366 | const showBankPicker = () => { | 380 | const showBankPicker = () => { |
| 367 | // 设置当前选中的值 | 381 | // 设置当前选中的值 |
| 368 | if (tempAccountInfo.value.bankName) { | 382 | if (tempAccountInfo.value.bankName) { |
| 369 | bankPickerValue.value = [tempAccountInfo.value.bankName]; | 383 | bankPickerValue.value = [tempAccountInfo.value.bankName]; |
| 370 | - } else { | 384 | + } else if (bankOptions.value.length > 0) { |
| 371 | bankPickerValue.value = [bankOptions.value[0].value]; | 385 | bankPickerValue.value = [bankOptions.value[0].value]; |
| 372 | } | 386 | } |
| 373 | showBankModal.value = true; | 387 | showBankModal.value = true; |
| ... | @@ -414,7 +428,7 @@ const saveAccountInfo = async () => { | ... | @@ -414,7 +428,7 @@ const saveAccountInfo = async () => { |
| 414 | try { | 428 | try { |
| 415 | // 调用API保存收款账号信息 | 429 | // 调用API保存收款账号信息 |
| 416 | const result = await updateProfileAPI({ | 430 | const result = await updateProfileAPI({ |
| 417 | - bank: tempAccountInfo.value.bankName, | 431 | + bank_id: tempAccountInfo.value.bankName, // 发送银行ID |
| 418 | bank_no: tempAccountInfo.value.bankAccount | 432 | bank_no: tempAccountInfo.value.bankAccount |
| 419 | }); | 433 | }); |
| 420 | 434 | ||
| ... | @@ -423,7 +437,7 @@ const saveAccountInfo = async () => { | ... | @@ -423,7 +437,7 @@ const saveAccountInfo = async () => { |
| 423 | 437 | ||
| 424 | // 更新全局用户状态 | 438 | // 更新全局用户状态 |
| 425 | userStore.updateUserInfo({ | 439 | userStore.updateUserInfo({ |
| 426 | - bank: tempAccountInfo.value.bankName, | 440 | + bank_id: tempAccountInfo.value.bankName, // 存储银行ID |
| 427 | bank_no: tempAccountInfo.value.bankAccount | 441 | bank_no: tempAccountInfo.value.bankAccount |
| 428 | }); | 442 | }); |
| 429 | 443 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-06 14:03:17 | 4 | + * @LastEditTime: 2025-08-06 15:30:03 |
| 5 | * @FilePath: /jgdl/src/pages/myOrders/index.vue | 5 | * @FilePath: /jgdl/src/pages/myOrders/index.vue |
| 6 | * @Description: 订单管理页面 | 6 | * @Description: 订单管理页面 |
| 7 | --> | 7 | --> |
| ... | @@ -627,7 +627,7 @@ const loadOrderData = async (isLoadMore = false) => { | ... | @@ -627,7 +627,7 @@ const loadOrderData = async (isLoadMore = false) => { |
| 627 | loading.value = true | 627 | loading.value = true |
| 628 | 628 | ||
| 629 | const type = viewMode.value === 'buy' ? 'buy' : viewMode.value === 'verification' ? 'verification' : 'sell' | 629 | const type = viewMode.value === 'buy' ? 'buy' : viewMode.value === 'verification' ? 'verification' : 'sell' |
| 630 | - | 630 | + |
| 631 | // 处理状态筛选逻辑 | 631 | // 处理状态筛选逻辑 |
| 632 | let status = undefined | 632 | let status = undefined |
| 633 | if (activeTab.value === 'completed') { | 633 | if (activeTab.value === 'completed') { |
| ... | @@ -643,42 +643,8 @@ const loadOrderData = async (isLoadMore = false) => { | ... | @@ -643,42 +643,8 @@ const loadOrderData = async (isLoadMore = false) => { |
| 643 | // 其他单一状态 | 643 | // 其他单一状态 |
| 644 | status = activeTab.value | 644 | status = activeTab.value |
| 645 | } | 645 | } |
| 646 | - const page = isLoadMore ? currentPage.value + 1 : 0 | ||
| 647 | 646 | ||
| 648 | - // TAG: 添加mock数据用于测试 | 647 | + const page = isLoadMore ? currentPage.value + 1 : 0 |
| 649 | - // if (page === 0) { | ||
| 650 | - // const mockOrder = { | ||
| 651 | - // id: `mock_${type}_${Date.now()}`, | ||
| 652 | - // status: 9, // 已发货/待收货状态 | ||
| 653 | - // created_time: new Date().toLocaleString('zh-CN'), | ||
| 654 | - // total_amount: 15000, | ||
| 655 | - // details: { | ||
| 656 | - // id: `detail_${Date.now()}`, | ||
| 657 | - // vehicle: { | ||
| 658 | - // id: `vehicle_${Date.now()}`, | ||
| 659 | - // brand: '雅迪', | ||
| 660 | - // model: 'DE2', | ||
| 661 | - // manufacture_year: 2023, | ||
| 662 | - // range_km: 60, | ||
| 663 | - // battery_capacity_ah: 48, | ||
| 664 | - // price: 15000, | ||
| 665 | - // front_photo: DEFAULT_COVER_IMG, | ||
| 666 | - // seller: { | ||
| 667 | - // nickname: '测试卖家', | ||
| 668 | - // phone: '138****8888' | ||
| 669 | - // } | ||
| 670 | - // } | ||
| 671 | - // }, | ||
| 672 | - // buyer: { | ||
| 673 | - // nickname: '测试买家', | ||
| 674 | - // phone: '139****9999' | ||
| 675 | - // }, | ||
| 676 | - // is_sold: false | ||
| 677 | - // } | ||
| 678 | - | ||
| 679 | - // const targetOrders = viewMode.value === 'buy' ? boughtOrders : soldOrders | ||
| 680 | - // targetOrders.value = [mockOrder] | ||
| 681 | - // } | ||
| 682 | 648 | ||
| 683 | const response = await getOrderListAPI({ | 649 | const response = await getOrderListAPI({ |
| 684 | type, | 650 | type, |
| ... | @@ -1330,7 +1296,6 @@ const performConfirmReceive = async (orderId) => { | ... | @@ -1330,7 +1296,6 @@ const performConfirmReceive = async (orderId) => { |
| 1330 | const response = await receiveOrderAPI({ order_id: order.id }) | 1296 | const response = await receiveOrderAPI({ order_id: order.id }) |
| 1331 | 1297 | ||
| 1332 | if (response.code) { | 1298 | if (response.code) { |
| 1333 | - // 接口返回状态为11,确认收货成功 | ||
| 1334 | order.status = 11 // 更新为已完成状态 | 1299 | order.status = 11 // 更新为已完成状态 |
| 1335 | 1300 | ||
| 1336 | Taro.showToast({ | 1301 | Taro.showToast({ | ... | ... |
| ... | @@ -1165,7 +1165,7 @@ const checkUserPermission = async () => { | ... | @@ -1165,7 +1165,7 @@ const checkUserPermission = async () => { |
| 1165 | Taro.navigateTo({ | 1165 | Taro.navigateTo({ |
| 1166 | url: '/pages/register/index' | 1166 | url: '/pages/register/index' |
| 1167 | }) | 1167 | }) |
| 1168 | - } else if (permissionResult.missingFields.includes('name') || permissionResult.missingFields.includes('bank') || permissionResult.missingFields.includes('bank_no') || permissionResult.missingFields.includes('idcard')) { | 1168 | + } else if (permissionResult.missingFields.includes('name') || permissionResult.missingFields.includes('bank_id') || permissionResult.missingFields.includes('bank_no') || permissionResult.missingFields.includes('idcard')) { |
| 1169 | // 收款信息未填写 | 1169 | // 收款信息未填写 |
| 1170 | Taro.redirectTo({ | 1170 | Taro.redirectTo({ |
| 1171 | url: '/pages/collectionSettings/index?target=sell' | 1171 | url: '/pages/collectionSettings/index?target=sell' | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-01-08 18:00:00 | 2 | * @Date: 2025-01-08 18:00:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-05 18:16:58 | 4 | + * @LastEditTime: 2025-08-06 17:43:41 |
| 5 | * @FilePath: /jgdl/src/stores/user.js | 5 | * @FilePath: /jgdl/src/stores/user.js |
| 6 | * @Description: 用户状态管理 | 6 | * @Description: 用户状态管理 |
| 7 | */ | 7 | */ |
| ... | @@ -25,7 +25,7 @@ export const useUserStore = defineStore('user', { | ... | @@ -25,7 +25,7 @@ export const useUserStore = defineStore('user', { |
| 25 | favorite_count: 0, | 25 | favorite_count: 0, |
| 26 | message_count: 0, | 26 | message_count: 0, |
| 27 | name: '', | 27 | name: '', |
| 28 | - bank: '', | 28 | + bank_id: '', |
| 29 | bank_no: '', | 29 | bank_no: '', |
| 30 | idcard: '', | 30 | idcard: '', |
| 31 | is_signed: false, | 31 | is_signed: false, |
| ... | @@ -48,8 +48,8 @@ export const useUserStore = defineStore('user', { | ... | @@ -48,8 +48,8 @@ export const useUserStore = defineStore('user', { |
| 48 | */ | 48 | */ |
| 49 | hasCompleteCollectionInfo: (state) => { | 49 | hasCompleteCollectionInfo: (state) => { |
| 50 | return !!( | 50 | return !!( |
| 51 | - state.userInfo.bank && state.userInfo.bank.trim() && | 51 | + state.userInfo.bank_id && state.userInfo.bank_id && |
| 52 | - state.userInfo.bank_no && state.userInfo.bank_no.trim() && | 52 | + state.userInfo.bank_no && state.userInfo.bank_no && |
| 53 | state.userInfo.name && state.userInfo.name.trim() && | 53 | state.userInfo.name && state.userInfo.name.trim() && |
| 54 | state.userInfo.idcard && state.userInfo.idcard.trim() | 54 | state.userInfo.idcard && state.userInfo.idcard.trim() |
| 55 | ) | 55 | ) |
| ... | @@ -120,7 +120,7 @@ export const useUserStore = defineStore('user', { | ... | @@ -120,7 +120,7 @@ export const useUserStore = defineStore('user', { |
| 120 | favorite_count: 0, | 120 | favorite_count: 0, |
| 121 | message_count: 0, | 121 | message_count: 0, |
| 122 | name: '', | 122 | name: '', |
| 123 | - bank: '', | 123 | + bank_id: '', |
| 124 | bank_no: '', | 124 | bank_no: '', |
| 125 | idcard: '', | 125 | idcard: '', |
| 126 | is_signed: false, | 126 | is_signed: false, | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-01-08 18:00:00 | 2 | * @Date: 2025-01-08 18:00:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-08-05 17:46:11 | 4 | + * @LastEditTime: 2025-08-06 17:43:47 |
| 5 | * @FilePath: /jgdl/src/utils/permission.js | 5 | * @FilePath: /jgdl/src/utils/permission.js |
| 6 | * @Description: 权限控制工具函数 | 6 | * @Description: 权限控制工具函数 |
| 7 | */ | 7 | */ |
| ... | @@ -40,7 +40,7 @@ const PERMISSION_CONFIG = { | ... | @@ -40,7 +40,7 @@ const PERMISSION_CONFIG = { |
| 40 | [PERMISSION_TYPES.SELL_CAR]: { | 40 | [PERMISSION_TYPES.SELL_CAR]: { |
| 41 | message: '发布车源需要先完善个人信息', | 41 | message: '发布车源需要先完善个人信息', |
| 42 | redirectUrl: '/pages/register/index', | 42 | redirectUrl: '/pages/register/index', |
| 43 | - checkFields: ['phone', 'name', 'bank', 'bank_no', 'idcard'] | 43 | + checkFields: ['phone', 'name', 'bank_id', 'bank_no', 'idcard'] |
| 44 | }, | 44 | }, |
| 45 | [PERMISSION_TYPES.BUY_CAR]: { | 45 | [PERMISSION_TYPES.BUY_CAR]: { |
| 46 | message: '购买车辆需要先完善个人信息', | 46 | message: '购买车辆需要先完善个人信息', | ... | ... |
-
Please register or login to post a comment