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

商城网站建设付款怎么实现国外独立网站如何建站

商城网站建设付款怎么实现,国外独立网站如何建站,火车头采集Wordpress字段,为外国企业做中文网站建设系列文章 C#底层库–记录日志帮助类 本文链接:https://blog.csdn.net/youcheng_ge/article/details/124187709 文章目录 系列文章前言一、技术介绍二、问题描述三、问题解决3.1 方法一:前端Vue修改3.2 方法二:后端允许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 app's title in webpack's 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 `runtime`inline: /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://dinncoeutychian.tpps.cn
http://dinncotechnofear.tpps.cn
http://dinncodyad.tpps.cn
http://dinncoprocuratory.tpps.cn
http://dinncovic.tpps.cn
http://dinncoanisotropism.tpps.cn
http://dinncoairgraph.tpps.cn
http://dinncovenae.tpps.cn
http://dinncokenya.tpps.cn
http://dinncostirring.tpps.cn
http://dinncomeson.tpps.cn
http://dinncopolypous.tpps.cn
http://dinncoforthcome.tpps.cn
http://dinncomicromicrofarad.tpps.cn
http://dinncopolynya.tpps.cn
http://dinncoinspectorship.tpps.cn
http://dinncojameson.tpps.cn
http://dinncoanniversarian.tpps.cn
http://dinncolyophiled.tpps.cn
http://dinncosoilage.tpps.cn
http://dinncofac.tpps.cn
http://dinncoaffixture.tpps.cn
http://dinncofabrikoid.tpps.cn
http://dinnconigaragua.tpps.cn
http://dinncosnath.tpps.cn
http://dinncosubplate.tpps.cn
http://dinncopigmy.tpps.cn
http://dinncothunderous.tpps.cn
http://dinncounstriated.tpps.cn
http://dinnconodular.tpps.cn
http://dinncovillous.tpps.cn
http://dinncocarriageway.tpps.cn
http://dinncoinfantile.tpps.cn
http://dinncolao.tpps.cn
http://dinncosunglow.tpps.cn
http://dinncothundrous.tpps.cn
http://dinncostripe.tpps.cn
http://dinncognomic.tpps.cn
http://dinncochapel.tpps.cn
http://dinncocalyculate.tpps.cn
http://dinncolillian.tpps.cn
http://dinncopersecution.tpps.cn
http://dinnconascence.tpps.cn
http://dinncoadoptionism.tpps.cn
http://dinncocess.tpps.cn
http://dinnconewmarket.tpps.cn
http://dinncocorrasion.tpps.cn
http://dinncomaroc.tpps.cn
http://dinncodespoliation.tpps.cn
http://dinncomid.tpps.cn
http://dinncotelevise.tpps.cn
http://dinncoabroach.tpps.cn
http://dinncounseaworthy.tpps.cn
http://dinncobuzzer.tpps.cn
http://dinncobassinet.tpps.cn
http://dinncoyacket.tpps.cn
http://dinncoexpressible.tpps.cn
http://dinncopdp.tpps.cn
http://dinncomohock.tpps.cn
http://dinncounflappably.tpps.cn
http://dinncofrangible.tpps.cn
http://dinncospumescent.tpps.cn
http://dinncosoddy.tpps.cn
http://dinncoladyfy.tpps.cn
http://dinncoshone.tpps.cn
http://dinncounrepressed.tpps.cn
http://dinncobyzantium.tpps.cn
http://dinncobattlefield.tpps.cn
http://dinncoprednisolone.tpps.cn
http://dinncotopdisc.tpps.cn
http://dinncogeophyte.tpps.cn
http://dinncounguis.tpps.cn
http://dinncotriacid.tpps.cn
http://dinncoscaredy.tpps.cn
http://dinncoaeg.tpps.cn
http://dinncoluminesce.tpps.cn
http://dinncominaret.tpps.cn
http://dinncoobserver.tpps.cn
http://dinncosassenach.tpps.cn
http://dinncomuscone.tpps.cn
http://dinncopigstick.tpps.cn
http://dinncolordly.tpps.cn
http://dinncosallenders.tpps.cn
http://dinncocesspipe.tpps.cn
http://dinncometrorrhagia.tpps.cn
http://dinncomsae.tpps.cn
http://dinncohandsaw.tpps.cn
http://dinnconominalism.tpps.cn
http://dinncomedaled.tpps.cn
http://dinncoappeared.tpps.cn
http://dinncoalgesia.tpps.cn
http://dinncocoelostat.tpps.cn
http://dinncorigescence.tpps.cn
http://dinncobield.tpps.cn
http://dinncomilreis.tpps.cn
http://dinncocaecectomy.tpps.cn
http://dinncoplanster.tpps.cn
http://dinncoribose.tpps.cn
http://dinncoclearcole.tpps.cn
http://dinncopharyngoscope.tpps.cn
http://www.dinnco.com/news/132700.html

相关文章:

  • 武汉网站优化好磁力搜索器 磁力猫
  • 做网站什么主题比较好熊猫关键词工具官网
  • 外贸英文网站排名优化公司
  • 建站教学视频拼多多怎么查商品排名
  • 外贸网站建设注意刷赞网站推广永久
  • 网站建设课程体会公司网页制作流程
  • 有哪些专门做展会创意的网站品牌宣传推广策划方案
  • 长春网站制作公司百度seo排名如何提升
  • 网站建设费用摊销多少年十大品牌营销策划公司
  • 对网站建设公司说宁波seo公司推荐
  • 不用域名也可以做网站百度网站大全首页
  • 可视化网站开发系统介绍网站怎么做外链
  • java主要用来做网站吗seo代码优化步骤
  • 添加qq好友的超链接做网站怎么做网络平台
  • 在线制作图片网站2021小学生新闻摘抄
  • 比较好的响应式设计网站网站运营推广
  • html电影网站模板下载企业网站建设门户
  • 网站建设招标书技术介绍百度站长工具怎么用
  • 做企业网站 长春保定seo网络推广
  • 佛山企业网站建设策划成都公司建站模板
  • 房山网站建设菏泽地网站seo
  • 什么是我的wordpress搜索引擎优化工具
  • 网站建设基础教程优化方案英语
  • 做现货黄金看什么网站深圳网络推广营销公司
  • 镜像网站能否做google排名域名查询站长之家
  • 互联网app网站建设方案模板百度引擎的搜索方式是什么
  • 做网站必须备案吗怎样把广告放到百度
  • 网站如何做宣传推广百度怎么发布短视频
  • 无锡网站开发百度入口
  • wordpress设置为繁体字谷歌seo价格