当前位置: 首页 > news >正文

网站设计开发的销售主要工作做网站专题页需要注意什么

网站设计开发的销售主要工作,做网站专题页需要注意什么,wordpress4.3.1下载,金融投资公司注册条件refer: http://ip-api.com/ 1.首先需要创建一个保存用户历史的登录的表#xff0c;然后连接go 2.在用户登录的时候#xff0c;获取用户的IP IP位置#xff0c;在后端直接处理数据即可#xff08;不需要在前端传递数据#xff09; #xff08;1#xff09;增加路由然后连接go 2.在用户登录的时候获取用户的IP IP位置在后端直接处理数据即可不需要在前端传递数据 1增加路由 apiv1.POST(/history_login_logs, v1.AddHistoryLoginLog) 2在model里增加例如models/history_login_logs.go   func AddHistoryLoginLog(user_id int, ip_address string, ip_location string, login_at time.Time) bool {db.Create(HistoryLoginLogs{UserId: user_id,IpAddress: ip_address,IpLocation: ip_location,LoginAt: login_at,})return true} (3) 在登录后的方法中增加需要引入 import(timeio/ioutilfmtencoding/json type Location struct {Status string json:statusCountry string json:countryCountryCode string json:countryCodeRegion string json:regionRegionName string json:regionNameCity string json:cityZip string json:zipLat float64 json:latLon float64 json:lonTimezone string json:timezoneIsp string json:ispOrg string json:orgAs string json:asQuery string json:query }... ipAddress : c.ClientIP() fmt.Println( ip_address:, ipAddress) resp, err : http.Get(http://ip-api.com/json/ ipAddress ?langzh-CN) if err ! nil {fmt.Println(Error:, err)return }defer resp.Body.Close()body, err : ioutil.ReadAll(resp.Body)if err ! nil {fmt.Println(Error:, err)return}var location Location err json.Unmarshal(body, location)if err ! nil {fmt.Println(Error:, err)return}fmt.Println( Location:, location) City : location.CitycurrentTime : time.Now() models.AddHistoryLoginLog(user.ID, ipAddress, City, currentTime) ... 4增加action 例如routers/api/v1/history_login_log.go需要引入import  net/http   time  fmt   type AddHistoryLoginLogRequest struct {UserID int json:user_id binding:requiredIPAddress string json:ip_address binding:requiredCity string json:ip_location binding:requiredCurrentTime time.Time json:login_at binding:required}func AddHistoryLoginLog(c *gin.Context) {var request AddHistoryLoginLogRequestif err : c.ShouldBindJSON(request); err ! nil {fmt.Println( err: , err)return}models.AddHistoryLoginLog(request.UserID, request.IPAddress, request.City, request.CurrentTime)} 3.在前端写一个展示的列表页面即可。登录时间写现在的时间即可。 例如src/pages/HistoryLoginLog/index.jsx import React, { Component } from react import { Table } from antd; import axios from axios import Config from /settings import { getToken, removeToken } from /utils/authconst columns [{title: 登录名,dataIndex: user_id,key: user_id,render: text a{text}/a,},{title: 登陆时间,dataIndex: login_at,key: login_at,// 这里是进行时间的处理转换为北京时间格式为2023/08/16 21:40render: text {const dateObj new Date(text);const localizedDate dateObj.toLocaleString(zh-CN, {timeZone: Asia/Shanghai,year: numeric,month: 2-digit,day: 2-digit,hour: 2-digit,minute: 2-digit,});return span{localizedDate}/span;},},{title: 登陆ip,dataIndex: ip_address,key: ip_address,},{title: 登陆位置,dataIndex: ip_location,key: ip_locatio,} ];export default class CalculationPlan extends Component {state {data: [],loading: true,}async fetchData() {try {const response await axios.get(${Config.BASE_URL}/api/v1/history_login_logs?token${getToken()})if (response.data.message ok) {const sortedData response.data.data.sort((a, b) new Date(b.id) - new Date(a.id));this.setState({data: sortedData,loading: false,})}} catch (error) {console.error(error)removeToken()window.location.href /}}componentDidMount() {this.fetchData()}render() {const { data, loading } this.statereturn (Table columns{columns} dataSource{data} loading{loading} /)} }
http://www.dnsts.com.cn/news/263952.html

相关文章:

  • 南宁网站建设nnxun网站设计与网页制作心得体会
  • 瑞丽市建设局网站用meteor框架做的微博网站
  • 庞各庄网站开发公司世界十大网站开发公司
  • 网站诊断方法租云服务器一个月多少钱
  • 网站建站维护运营郑州正规公司网站建设服务
  • 帮企业做网站的公司天津市建设 中标公示网站
  • 网站收录不好怎么办济南seo排名优化推广
  • 网站ps照片怎么做的wordpress生成静态地图
  • 网站建设北京网页微博登录
  • 网站设计建设 公司wordpress 数据导入
  • 网站开发公司 重庆网站建设 技术协议
  • 做响应网站wordpress vpn
  • 合伙开公司建设网站被骗汕头建站服务
  • 旅游网站结构图免费正规大数据查询平台
  • 晋中市建设局网站网上运营培训班
  • 易思企业网站管理成都建设网站制作
  • 美工个人网站网站的功能有哪些
  • 装修公司做网站的好处网络运营推广怎么做
  • 保山市建设厅网站3d网站建设制作
  • asp网站管理系统源码利尔化学股票股吧
  • 个人网站怎么做推广wordpress用哪个seo
  • 天元建设集团有限公司标志seo服务加盟
  • 创办网站公司阿里巴巴seo站内优化方法
  • 怎么做商业网站模板美工培训费用
  • 学校网站建设联系电话分销网站建立
  • 平台企业是什么意思瑞安网站建设优化
  • 外贸开源网站网站架构 seo
  • 怎么做外贸企业网站企业网站源码带后台
  • 做网站如何收集资料做阿里巴巴的网站的费用
  • 临汾网站开发找人做网站内容自己编辑吗