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

电商网站后台wordpress站点临时关闭

电商网站后台,wordpress站点临时关闭,做网站算经商吗,长尾关键词挖掘词工具系列文章 C#底层库–记录日志帮助类 本文链接#xff1a;https://blog.csdn.net/youcheng_ge/article/details/124187709 文章目录 系列文章前言一、技术介绍二、问题描述三、问题解决3.1 方法一#xff1a;前端Vue修改3.2 方法二#xff1a;后端允许Cors跨越访问 四、资源…系列文章 C#底层库–记录日志帮助类 本文链接https://blog.csdn.net/youcheng_ge/article/details/124187709 文章目录 系列文章前言一、技术介绍二、问题描述三、问题解决3.1 方法一前端Vue修改3.2 方法二后端允许Cors跨越访问 四、资源链接 前言 本专栏为【H5】主要介绍前端知识点。 一、技术介绍 跨越介绍 二、问题描述 vue2与netcore webapi跨越问题解决 三、问题解决 3.1 方法一前端Vue修改 配置代理转发加URL拦截转换成新的URL vue.config.js文件加一下代码 proxy:{/api: { // api表示拦截以/api开头的请求路径target: http://localhost:5296/api, //跨域的域名changeOrigin:true,//是否开启跨域pathRewrite:{ ^/api: // 重写请求把/api变为空字符}}}3.2 方法二后端允许Cors跨越访问 Program.cs文件 //配置跨域 builder.Services.AddCors(c {c.AddDefaultPolicy(policy {policy.AllowAnyOrigin()//允许所有来源的访问.AllowAnyHeader()//允许所有类型的请求头.AllowAnyMethod();//允许所有类型的请求}); });启动跨越在run之前 app.UseCors(); app.UseHttpsRedirection();四、资源链接 vue.config.js文件 use strict const path require(path) const defaultSettings require(./src/settings.js)function resolve(dir) {return path.join(__dirname, dir) }const name defaultSettings.title || vue Admin Template // page title// If your port is set to 80, // use administrator privileges to execute the command line. // For example, Mac: sudo npm run // You can change the port by the following methods: // port 9528 npm run dev OR npm run dev --port 9528 const port process.env.port || process.env.npm_config_port || 9528 // dev port// All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports {/*** You will need to set publicPath if you plan to deploy your site under a sub path,* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,* then publicPath should be set to /bar/.* In most cases please use / !!!* Detail: https://cli.vuejs.org/config/#publicpath*/publicPath: /,outputDir: dist,assetsDir: static,lintOnSave: process.env.NODE_ENV development,productionSourceMap: false,devServer: {port: port,open: true,overlay: {warnings: false,errors: true},proxy:{/api: { // api表示拦截以/api开头的请求路径target: http://localhost:5296/api, //跨域的域名changeOrigin:true,//是否开启跨域pathRewrite:{ ^/api: // 重写请求把/api变为空字符}}}},configureWebpack: {// provide the apps title in webpacks name field, so that// it can be accessed in index.html to inject the correct title.name: name,resolve: {alias: {: resolve(src)}}},chainWebpack(config) {// it can improve the speed of the first screen, it is recommended to turn on preloadconfig.plugin(preload).tap(() [{rel: preload,// to ignore runtime.js// https://github.com/vuejs/vue-cli/blob/dev/packages/vue/cli-service/lib/config/app.js#L171fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],include: initial}])// when there are many pages, it will cause too many meaningless requestsconfig.plugins.delete(prefetch)// set svg-sprite-loaderconfig.module.rule(svg).exclude.add(resolve(src/icons)).end()config.module.rule(icons).test(/\.svg$/).include.add(resolve(src/icons)).end().use(svg-sprite-loader).loader(svg-sprite-loader).options({symbolId: icon-[name]}).end()// set preserveWhitespaceconfig.module.rule(vue).use(vue-loader).loader(vue-loader).tap(options {options.compilerOptions.preserveWhitespace truereturn options}).end()config.when(process.env.NODE_ENV ! development,config {config.plugin(ScriptExtHtmlWebpackPlugin).after(html).use(script-ext-html-webpack-plugin, [{// runtime must same as runtimeChunk name. default is runtimeinline: /runtime\..*\.js$/}]).end()config.optimization.splitChunks({chunks: all,cacheGroups: {libs: {name: chunk-libs,test: /[\\/]node_modules[\\/]/,priority: 10,chunks: initial // only package third parties that are initially dependent},elementUI: {name: chunk-elementUI, // split elementUI into a single packagepriority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or apptest: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm},commons: {name: chunk-commons,test: resolve(src/components), // can customize your rulesminChunks: 3, // minimum common numberpriority: 5,reuseExistingChunk: true}}})// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunkconfig.optimization.runtimeChunk(single)})} } Program.cs文件 using System.Configuration; using WebApplication5;var builder WebApplication.CreateBuilder(args);// Add services to the container.//配置跨域 builder.Services.AddCors(c {c.AddDefaultPolicy(policy {policy.AllowAnyOrigin()//允许所有来源的访问.AllowAnyHeader()//允许所有类型的请求头.AllowAnyMethod();//允许所有类型的请求}); });builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen();var app builder.Build();app.UseCors(); app.UseHttpsRedirection();if (app.Environment.IsDevelopment()) {app.UseSwagger();app.UseSwaggerUI(); }app.UseHttpsRedirection();app.UseAuthorization();app.MapControllers();app.Run();
http://www.w-s-a.com/news/896498/

相关文章:

  • 做小型企业网站多少钱衡阳市建设局网站
  • 金华专业网站建设公司网站建设空间和服务器方式
  • 自己做的网站在浏览器上显示不安全吗wordpress revolution slider
  • 西安网站建设推广优化搜索引擎营销
  • 互联网站备案管理工作方案 工信部注册深圳公司需要什么条件
  • 网站网站服务器网站建设 物流
  • 国外开发网站手机网站建设制作
  • 怎么把自己做的网站传网上青岛工程建设监理公司网站
  • 网站301跳转效果商丘网站公司
  • 公司网站建设西安网站的架构与建设
  • 食品科技学校网站模板花溪村镇建设银行网站
  • 图片渐隐 网站头部flash地方志网站建设自查报告
  • 深圳做商城网站视觉品牌网站建设
  • 永康电子商务网站建设弹幕网站怎么做
  • 百川网站企业做网站要注意哪些
  • 球迷类的网站如何做网站建设需要哪些素材
  • 请问有重庆有做网站吗电子政务系统网站建设的基本过程
  • 建设银行管方网站官网最新版cmsv6
  • 网站开发工程师需要会写什么深圳网站(建设信科网络)
  • 台州网站搭建网站建设需求计划
  • 网站app免费下载软件大全大连百度推广哪家好
  • 网站建设的面试要求iis做的网站手机怎么访问
  • 定州市住房保障和城乡建设局网站上海网站建设排行
  • 网站发帖百度收录网站改版后不收录
  • 昆明建设局网站号码网站开发 浏览器兼容性
  • 湖北专业网站建设大全室内设计联盟app下载
  • 网站建设的意义和作用江苏城市建设档案馆网站
  • 华为云速建站贴心的广州网站建设
  • 网页网站开发公司天津seo推广
  • 网站线框图用什么做共享门店新增礼品卡兑换模式