課程
/后端開發(fā)
/Java
/SpringBoot構(gòu)建電商基礎(chǔ)秒殺項目
??
還有其他的地方會需要注意的嗎,就是獲取不到session存儲的驗證碼
2021-04-03
源自:SpringBoot構(gòu)建電商基礎(chǔ)秒殺項目 3-8
正在回答
你不要在項目外部用文件方式打開,改在項目里操作,具體操作見我上面的貼圖。
同時檢查你的代碼,嘗試保持跟我以下的代碼一致,試試看
1、UserController 類首處
@RestController
@RequestMapping("/user")
@CrossOrigin(allowCredentials = "true", allowedHeaders = "*")
public class UserController extends BaseController {
2、getOtp方法
@RequestMapping(value = "/getotp", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
@ResponseBody
public CommonResponse getOtp(@RequestParam(name = "telphone") String telphone){
3、register方法
@Transactional
@RequestMapping(value = "/register", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
public CommonResponse register(@RequestParam(name = "telphone") String telphone,
可是我就是用的谷歌呀
樓主,我已解決此問題,我的代碼沒有問題,只需要更改前端訪問方式即可。
結(jié)果如下:
此問題困擾我2天,內(nèi)心的煎熬萬馬奔騰,日不能食、夜不能寢、妹不想把!
終于搞定?。?!
LZ,我也遇到一樣的情況,前后端都跨越授信了啊,sessionOptCodey一直是null,百思不得其解!
各種招都嘗試過了,依然null,null,null! 請三少老師指點迷津?,多謝!?。?/p>
后端授信:
前端Ajax授信:
1、getotp.html
2、register.html
UserController的代碼:
Debug結(jié)果,困惑ING...
舉報
應(yīng)用SpringBoot快速搭建擁有用戶、商品、交易及秒殺活動的電商秒殺應(yīng)用。
3 回答session中的值獲取不到
3 回答獲取不到Session(),兩次得到的不是同一個session
5 回答session獲取不到
6 回答OrderController中獲取的session為空
1 回答前端代碼中的data.data.errMsg和data.responseText獲取不到值
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2021-04-07
你不要在項目外部用文件方式打開,改在項目里操作,具體操作見我上面的貼圖。
同時檢查你的代碼,嘗試保持跟我以下的代碼一致,試試看
1、UserController 類首處
@RestController
@RequestMapping("/user")
@CrossOrigin(allowCredentials = "true", allowedHeaders = "*")
public class UserController extends BaseController {
2、getOtp方法
@RequestMapping(value = "/getotp", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
@ResponseBody
public CommonResponse getOtp(@RequestParam(name = "telphone") String telphone){
3、register方法
@Transactional
@RequestMapping(value = "/register", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
@ResponseBody
public CommonResponse register(@RequestParam(name = "telphone") String telphone,
2021-04-07
可是我就是用的谷歌呀
2021-04-07
樓主,我已解決此問題,我的代碼沒有問題,只需要更改前端訪問方式即可。
結(jié)果如下:
此問題困擾我2天,內(nèi)心的煎熬萬馬奔騰,日不能食、夜不能寢、妹不想把!
終于搞定?。?!
2021-04-06
LZ,我也遇到一樣的情況,前后端都跨越授信了啊,sessionOptCodey一直是null,百思不得其解!
各種招都嘗試過了,依然null,null,null! 請三少老師指點迷津?,多謝!?。?/p>
后端授信:
前端Ajax授信:
1、getotp.html
2、register.html
UserController的代碼:
Debug結(jié)果,困惑ING...