vue3前端开发系列 - 项目框架搭建篇

news2024/10/6 20:26:15

文章目录

  • 1. 项目初始化
    • 1.1 项目目录结构
    • 1.2 相关组件列表
    • 1.3 创建项目
  • 2. 重置样式表
  • 3.设置路径别名
  • 4. 设置环境变量
  • 5.状态存储(Pinia)
    • 5.1 安装插件
    • 5.2 配置
    • 5.3 用户信息案例
      • 5.3.1 状态存储设置
      • 5.3.2 使用用户信息
  • 6. 路由设置(Router)
    • 6.1 安装路由插件
    • 6.2 配置路由
  • 7. 安装element-plus
  • 8. 网络请求设置
    • 8.1 安装
    • 8.1 网络请求封装
    • 8.2 封装API
  • 9.跨域处理
  • 10. rem适配(移动端)

1. 项目初始化

1.1 项目目录结构

完整的项目目录结构如下:
在这里插入图片描述

1.2 相关组件列表


# 状态存储
pnpm i pinia -S

# 状态存储持久化(可选)
pnpm i pinia-plugin-persistedstate

# 路由
pnpm i vue-router

# 安装内置node,用于path别名设置
pnpm i -D @types/node

# API
pnpm i @vueuse/core -S
# 网络请求
pnpm i axios -S

# 动画(可选)
pnpm i animate.css

# UI
pnpm i element-plus
pnpm i @element-plus/icons-vue

# 样式
pnpm i less
pnpm i -D sass

# (可选)
pnpm i moment

# 原子化样式(可选)
pnpm i unocss 

1.3 创建项目

使用pnpm创建vite项目。

pnpm create vite

#输入项目名
Project name: vue3-template

# 选择前端框架
Select a framework: Vue

# 选择语言
Select a variant: Typescript

安装和启动:

cd vitedemo
pnpm install
pnpm run dev

2. 重置样式表

reset.css和normalize.css可以都放到src/assets/css/目录下

PC端:reset.css

@charset "utf-8";
 
/* CSS Document */
* { color:#444; }
body { font:12px/1.5 "微软雅黑",Arial,Tahoma, Helvetica,\5b8b\4f53, sans-serif; }
html,body,div,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,object,code,em,span,var,legend,button,input,textarea,th,td,a,img,header,footer,nav,aside,audio,datalist,section { margin:0;padding:0;border:0;outline:0; }/*清除内外边距*/
h1,h2,h3,h4,h5,h6 { font-weight:normal;font-size:100%; }/*设置默认字体*/
:focus { outline:0; }
ul,ol,ul li,ol li { list-style: none; }/*重置列表*/
address,caption,cite,em,code,dfn,th,var { font-style:normal;font-weight:normal; }
form label { cursor:pointer; }
input,button,select,textarea { font-family:inherit;font-size:100%;outline:none; }
textarea { resize:none }
input { vertical-align:middle; }
img { border:0; }/*重置图片元素*/
table { border-collapse:collapse;border-spacing: 0; }/*重置表格*/
.l { float:left; }
.r { float:right; }
button,input[type="reset"],input[type="button"],input[type="submit"] { line-height:normal !important; }
a { text-decoration:none;}
a { color:#666;}
a:hover { text-decoration:underline; }
input { _filter:chroma(color=#000000); }
/*--清除浮动
------------------------------------------------------------------------------------------*/
.clearfix:after { clear:both;content:".";display:block;font-size:0;height:0;visibility:hidden; }
.clearfix:after { _zoom:1; }
.overflow { overflow:hidden; _zoom:1; }
.clear { clear:both; height:0;font-size:0; overflow:hidden; }

APP端:normalize.css
Normalize.css 使浏览器呈现所有 HTML 元素更加一致,并且符合现代 web 标准。
Normalize.css 只作用于需要规范化的样式。

/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
 
/* Document
   ========================================================================== */
 
/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */
 
html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}
 
/* Sections
   ========================================================================== */
 
/**
 * Remove the margin in all browsers.
 */
 
body {
  margin: 0;
}
 
/**
 * Render the `main` element consistently in IE.
 */
 
main {
  display: block;
}
 
/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */
 
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
 
/* Grouping content
   ========================================================================== */
 
/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */
 
hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}
 
/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
 
pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}
 
/* Text-level semantics
   ========================================================================== */
 
/**
 * Remove the gray background on active links in IE 10.
 */
 
a {
  background-color: transparent;
}
 
/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */
 
abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}
 
/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */
 
b,
strong {
  font-weight: bolder;
}
 
/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
 
code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}
 
/**
 * Add the correct font size in all browsers.
 */
 
small {
  font-size: 80%;
}
 
/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */
 
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
 
sub {
  bottom: -0.25em;
}
 
sup {
  top: -0.5em;
}
 
/* Embedded content
   ========================================================================== */
 
/**
 * Remove the border on images inside links in IE 10.
 */
 
img {
  border-style: none;
}
 
/* Forms
   ========================================================================== */
 
/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */
 
button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}
 
/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */
 
button,
input { /* 1 */
  overflow: visible;
}
 
/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */
 
button,
select { /* 1 */
  text-transform: none;
}
 
/**
 * Correct the inability to style clickable types in iOS and Safari.
 */
 
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}
 
/**
 * Remove the inner border and padding in Firefox.
 */
 
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}
 
/**
 * Restore the focus styles unset by the previous rule.
 */
 
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}
 
/**
 * Correct the padding in Firefox.
 */
 
fieldset {
  padding: 0.35em 0.75em 0.625em;
}
 
/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */
 
legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}
 
/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */
 
progress {
  vertical-align: baseline;
}
 
/**
 * Remove the default vertical scrollbar in IE 10+.
 */
 
textarea {
  overflow: auto;
}
 
/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */
 
[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}
 
/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */
 
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}
 
/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */
 
[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}
 
/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */
 
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}
 
/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */
 
::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}
 
/* Interactive
   ========================================================================== */
 
/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */
 
details {
  display: block;
}
 
/*
 * Add the correct display in all browsers.
 */
 
summary {
  display: list-item;
}
 
/* Misc
   ========================================================================== */
 
/**
 * Add the correct display in IE 10+.
 */
 
template {
  display: none;
}
 
/**
 * Add the correct display in IE 10.
 */
 
[hidden] {
  display: none;
}
 

3.设置路径别名

项目别名配置的时候需要用的 path 模块,而path模块是node.js的内置模块,node不支持TS。
(1) 所以在配置别名的时候,需要先执行 pnpm i -D @types/node
(2) 然后修改文件vite.config.ts

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

//引入path模块
import {resolve} from "path"

// https://vitejs.dev/config/
export default defineConfig({
  //配置别名
  resolve:{
    alias:{
      '@': resolve(__dirname,"src"),
      '~': resolve(__dirname,"src")
    }
  },
  plugins: [vue()],
})

(3) 再修改tsconfig.json
在compilerOptions中添加下面配置:

  /*别名配置*/
  "baseUrl": "./",
  "paths": {
    "@/*":["src/*"],
  }

引入组件示例:
在这里插入图片描述

4. 设置环境变量

环境变量,可以根据不同的配置不同的参数值。比如开发环境、测试环境、生产环境都使用不同的服务器IP地址。
所以通过切换不同的环境变量,满足不同的场景需求。

在**项目根目录(通常是src目录外面)**新建.env.development和.env.production两个文件。
.env.development

NODE_ENV = 'development'

# 以VITE开头
VITE_BASE_API = "http://localhost:56518"  
VITE_BASE_URL='https://csdnvip.blog.csdn.net/' 

.env.production

NODE_ENV = 'production'

# 以VITE开头
VITE_BASE_API = "http://localhost:11111" 
VITE_BASE_URL='https://csdnvip.blog.csdn.net/' 

如果两个文件(.env.development和.env.production)在src文件夹里面,那么可以通过在vite.config.ts文件中设置envDir的值为"./src",
这样,这两个文件也可以生效。
在这里插入图片描述

在package.json中的scripts配置不同的场景模式:

    "dev": "vite --mode development",
    "prod": "vite --mode production",

在这里插入图片描述

为了在代码中获取用户自定义环境变量的TypeScript智能提示,还需要在根目录新建env.d.ts文件:

//可以在在代码中获取用户自定义环境变量的TypeScript智能提示
interface ImportMetaEnv {
  readonly VITE_BASE_API: string
  // 更多环境变量 ...
}

interface ImportMeta {
  readonly env: ImportMetaEnv
}

验证环境变量取值:
在App.vue中打印环境变量:

<template>
<router-view></router-view>
</template>

<script setup lang='ts'>
  console.log(import.meta.env.NODE_ENV)
  console.log(import.meta.env.VITE_BASE_API)
  console.log(import.meta.env.VITE_BASE_URL)
</script>
<style scoped>

</style>

在这里插入图片描述

由于启动时,使用的是pnpm run dev模式启动,所以读取到的是.env.development文件中的值。
可以看到VITE_BASE_API和VITE_BASE_URL的值都打印出来了,但是NODE_ENV的值并没有显示出来。
这是由于默认只能读取VITE前缀的变量的值。

如果需要读取其他前缀的变量的值,可以在vite.config.ts文件中添加以下配置:

  //读取下列前缀开头的变量,注意这里也要把VITE加入进去,否则VITE开头的读取不到
  envPrefix: ["VITE_","APP_","NODE_"],

在这里插入图片描述

5.状态存储(Pinia)

5.1 安装插件

# 安装pinia,用于状态存储
pnpm i pinia -S

# 安装pinia插件,用于状态存储持久化
pnpm i pinia-plugin-persistedstate -S

5.2 配置

# 引入插件
import {createPinia} from "pinia"
import {createPersistedState} from "pinia-plugin-persistedstate"

# 全局配置
const pinia = createPinia()
app.use(pinia)

# pinia的持久化全局配置
pinia.use(createPersistedState({
  storage: localStorage,
  key: id => `__persisted__${id}`,  //指定key的设置
  auto: true
}))

5.3 用户信息案例

5.3.1 状态存储设置

创建状态存储的文件夹src/store
创建保存用户信息的文件src/store/user.ts用来存储用户信息。
useUserStore是约定俗成的规则,useXXXXStore规则。

import { defineStore } from "pinia"

export const useUserStore = defineStore({
  id: "user",
  state: () => {
    return {
      token: "",
      userInfo: {}
    }
  },

  //方法
  actions: {
    setUserInfo(data: any) {
      this.token = data.token
      this.userInfo = data.user_info
    }
  }
})

5.3.2 使用用户信息

6. 路由设置(Router)

6.1 安装路由插件

pnpm i vue-router -S

创建路由的文件夹src/router

6.2 配置路由

(1) 配置路由包
在main.ts中

import router from "@/router"

app.use(router)

(2) 配置路由规则
在/src/router/index.ts中

//createRouter:用于创建vue-router实例对象
//RouteRecordRaw: 用于规范,路由规则,增加路由对象类型限制
//createWebHistory

import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"


//创建路由规则
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    component: () => import("@/views/index.vue"),
  },
  {
    path: "/login",
    component: () => import("@/views/public/login/index.vue"),
    children: []
  }
]

//创建路由实例
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes
})

//路由导航守卫
import { useUserStore } from "@/store/user"
router.beforeEach((to, from, next) => {
  const user = useUserStore()
  if (user.token) {
    next()
  } else {
    // router.push({ path: "/" })
    console.log("未登录")
  }

})
export default router

7. 安装element-plus

安装element插件

pnpm i element-plus
pnpm i @element-plus/icons-vue

安装自动导入插件

pnpm install -D unplugin-vue-components unplugin-auto-import

修改vite.config.ts

//自动导入组件以及样式
//注意unplugin-auto-import后面是vite
const AutoImport = require('unplugin-auto-import/vite');
const Components = require('unplugin-vue-components/vite');
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers');

然后在plugins中添加:

    AutoImport({
      resolvers: [ElementPlusResolver()]
    }),
    Components({
      resolvers: [ElementPlusResolver()]
    })

更新后的完整内容如下:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from "path"

//自动导入组件以及样式
const AutoImport = require('unplugin-auto-import/vite');
const Components = require('unplugin-vue-components/vite');
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers');

// https://vitejs.dev/config/
export default defineConfig({
  base: process.env.ELECTRON == "true" ? './' : "./",
  plugins: [
    vue(),

    //自动导入组件
    AutoImport({
      resolvers: [ElementPlusResolver()]
    }),
    Components({
      resolvers: [ElementPlusResolver()]
    })
  ],

  resolve: {
    alias: {
      "@": resolve(__dirname, "src")
    }
  }
})

修改main.ts,引入样式和导入图标库

import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

图标库需要遍历加入app的组件.

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

完整的main.ts如下:

import { createApp } from 'vue'
import '@/assets/css/reset.css'
import App from './App.vue'
import router from "@/router"
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(router)
app.mount('#app')

这样在使用element-plus的组件的时候,就不需要再额外导入了。

8. 网络请求设置

8.1 安装

# Api插件
pnpm i @vueuse/core -S
# 网络请求
pnpm i axios -S


创建/src/util/request.ts

8.1 网络请求封装

import { useUserStore } from "@/store/user"
import axios from "axios"
import {ElMessage} from "element-plus"

const service = axios.create({
  baseURL: "/api", //请求的基础路径设置
  timeout: 10000
})

//请求拦截器
service.interceptors.request.use((config) => {
  const userStore = useUserStore()
  if(userStore.token){
    config.headers.token = userStore.token
  }
  return config
},(error) => {
  return Promise.reject(error)
})

//响应拦截器
service.interceptors.response.use((response) => {
  return response.data
},(error) =>{
  // let status = error.response.status 
  ElMessage.error(error.message)
  return Promise.reject(new Error(error.message))
})


export default service

8.2 封装API

封装api,在api中使用上面的request.ts中封装的网络请求。
新建文件src/api/user.ts,用来请求用户信息

import request from "@/utils/request"

//get
export const getUser = (data:any) =>{
  return request({
    url:"user/list",
    method:"get",
    params:data
  })
}

//post
export const editUser = (data:any) =>{
  return request({
    url:"user/edit",
    method:"post",
    params:data
  })
}

9.跨域处理

修改vite.config.ts

  //跨域代理设置
  server: {
    port: 8002,
    //允许跨域
    cors: true,
    //遇到api开头的,自动替换为target对应的地址请求
    proxy: {  
      '/api': {  //注意:这里的api要和request.ts中的baseURL保持一致
        target: "http://xxxx.com",
        changeOrigin: true
      }
    }

  },

10. rem适配(移动端)

如果是移动端开发,需要配置该项,PC端不需要。
创建 /src/utils/rem.ts

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1083548.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

光耦合器继电器与传统继电器:哪种最适合您的项目?

在电子和电气工程领域&#xff0c;继电器的选择可以显着影响项目的性能和安全性。两种常见类型的继电器是光耦合器继电器和传统机电继电器。每个都有其优点和缺点&#xff0c;因此选择过程对于项目的成功结果至关重要。 光耦合器继电器&#xff1a;基础知识 光耦合器继电器&…

亚运之后,AI如何实现保障普通人的运动安全?

刚刚结束的2023年杭州亚运会带动了一波全民运动热潮。481个运动项目中&#xff0c;篮球、游泳、羽毛球、滑板等运动项目早已融入到普通人的日常生活中&#xff0c;这些运动不仅可以帮助人们增强身体素质&#xff0c;还可以提高心理健康水平&#xff0c;减轻压力和焦虑&#xff…

MacOS Pro笔记本硬盘升级纪实

背景 MacPro 2015 mid的苹果本&#xff0c;忽然心血来潮想升级一下SSD。三个步骤&#xff1a;做启动盘&#xff0c;时间机器备份&#xff0c;插新的SSD盘恢复。 过程 下载MacOS&#xff0c;macOS Monterey 12.7官方原版镜像&#xff1a; https://swcdn.apple.com/content/do…

【产品】智能结构仿真软件AIFEM 2023R2新版本功能介绍

AIFEM是由天洑自主研发的一款通用的智能结构仿真软件&#xff0c;助力用户解决固体结构相关的静力学、动力学、振动、热力学等实际工程问题&#xff0c;软件提供高效的前后处理工具和高精度的有限元求解器&#xff0c;帮助用户快速、深入地评估结构的力学性能&#xff0c;加速产…

mysql case when 不命中缓存

case when 在sql 中非常方便数据不同维度统计&#xff0c;但是也会出现mysql 索引不命中问题&#xff0c;当多个case 出现时&#xff0c;需要提取出来到where里面优化 优化后 SELECT date(RecordTime) AS date, count( DISTINCT CASE WHEN Param 1 …

Java基于SpringBoot+Vue的考研资讯平台

1 简介 大家好&#xff0c;我是程序员徐师兄&#xff0c;今天为大家带来的是Java基于SpringBootVue的考研资讯平台 Java基于SpringBoot的考研资讯平台&#xff0c;在系统当中学生可以根据不同的信息来实现该网站的考研资讯平台信息的管理。 系统主要分为前台和后台。主要包括…

linux之cpu模拟负载程序

工作中我们经常会遇到这样的问题&#xff0c;需要模拟cpu的负载程序&#xff0c;例如模拟cpu占有率抬升10%、20%、50%、70%等&#xff0c;那这样的程序应该如何实现呢&#xff1f;它的原理是什么样的呢&#xff1f; 思想 创建一个应用程序&#xff0c;该应用程序的作用可以根…

如何实现制造业信息化转型?

一、制造业信息化历史 &#xff08;1&#xff09;1930年代 库存控制、管理 当时计算机系统尚未出现&#xff0c;人们为了解决库存管控的难题&#xff0c;提出了订货点法——当库存量降低到某一预先设定的点时&#xff0c;即开始发出订货单补充库存&#xff0c;直至库存量降低…

git删除文件

qt中点击删除文件后&#xff0c;不要从git版本控制中删除此文件 git rm test.txt 然后git add&#xff0c;git commit-m""

PLSQL下载并安装

官方下载连接&#xff1a;https://www.allroundautomations.com/registered-plsqldev/ 我们这边下载12.0.7版本 别忘了一起下载中文安装包 下载完全部安装一下 产品编号Product Code: kfj6yg6rfyhqcha6cbgs6fsw3kyje7a6qr 序列号Serial Number: 276182 口令Password: xs374c…

Linux简单磁盘命令

查看磁盘总站用量&#xff1a;df -h 查看当前目录的子目录磁盘占用情况: du -sh ./*

【高等数学】极限(下)(最全万字详解)

文章目录 极限(上)超链接5、极限存在法则5.1、夹逼准则5.1.1、数列夹逼准则5.1.2、函数夹逼准则5.1.3、第一重要极限 5.2、单调有界准则5.2.1、第二重要极限 6、函数的连续性与间断点6.1、函数的连续性6.1.1、定义6.1.2、左连续右连续 6.2、函数的间断点6.2.1、第一类间断点6.2…

炒股杠杆加杠杆安全|股票杠杆的安全玩法是怎样?

炒股杠杆和股票杠杆是一种高风险高收益的投资方式&#xff0c;需要在了解风险和做好风险管理的前提下进行。下面将介绍一些股票杠杆的安全玩法&#xff0c;帮助你更好地理解这种投资方式。 1. 了解自己的风险承受能力 在投资前&#xff0c;你需要了解自己的风险承受能力&…

云贝教育 |【DSI】Oracle数据库系列课-葵花宝典技术内幕实战课程

云贝教育DSI系列课&#xff1a; Oracle数据库深入浅出 零基础课程【DSI系列Ⅰ】 Oracle数据库特殊恢复原理与实战【DSI系列Ⅱ】 Oracle数据库 SQL Tuning【DSI系列Ⅲ】 Oracle数据库 DB Performance Tuning【DSI系Ⅳ】 DSI的意义 DSI课程是基于Oracle DSI403e和BBED工具修…

JUC并发工具类在大厂的应用场景详解

jdk提供了比synchronized更加高级的各种同步工具&#xff0c;包括 ReentrantLock 、 Semaphore 、 CountDownLatch 、 CyclicBarrier等&#xff0c;可以实现更加丰富的多线程操作。 (前三个是重点) 一. ReentrantLock ReentrantLock是一种可重入的独占锁&#xff0c;它允许同一…

spark集群环境下,实现人口平均年龄计算

文章目录 任务目标0. 版本信息1. 计算生成renkou.txt2. 文件上传至spark3. 上传文件时&#xff0c;可能出现的常见错误4. 编写spark文件5. 上传集群6. 集群环境下提交任务 任务目标 在虚拟机上部署spark集群&#xff0c;给定renkou.txt文件&#xff0c;输出平均年龄 renkou.t…

淘宝天猫商品评论数据接口,淘宝天猫商品评论API接口,淘宝API

淘宝商品评论数据接口可以通过淘宝开放平台API获取。 通过构建合理的请求URL&#xff0c;可以向淘宝服务器发起HTTP请求&#xff0c;获取商品评论数据。接口返回的数据一般为JSON格式&#xff0c;包含了商品的各种评价信息。获取到商品评论数据后&#xff0c;可以对其进行处理…

京东商品评论数据接口,京东API接口

京东商品评论内容数据接口步骤如下&#xff1a; 访问京东开放平台并注册一个开发者账号。创建一个应用并获取到API的权限。在开发者的控制台中找到API的使用文档。在文档中找到获取商品评论的API接口&#xff0c;点击获取key和secret。构造请求URL&#xff0c;请求URL的路径为…

SAP-MM/QM 移动原因维护

业务场景&#xff1a; 质检反馈现有的几种退货原因不能满足业务需求&#xff0c;需要增加&#xff0c;那么启用质检的退货原因和未启用质检的退货原因分别在哪里维护呢&#xff1f; 经过查找&#xff0c;退货原因不是按模块区分的&#xff0c;而是按移动类型确定的&#xff0c…

CRM系统:客户培育提高业绩的方法

多数情况下客户线索不会在首次沟通后就表现出强烈购买的意愿&#xff0c;这期间需要经过不断地沟通和培育才能进入到产品购买阶段。CRM客户管理系统帮助销售挖掘价值客户、高效跟进客户直至成交。下面说说&#xff0c;CRM系统如何客户培育提高业绩。 一、筛选潜在客户 企业客…